Unbalanced time sequence classification method based on generative adversarial graph network

By using the method of generating adversarial graph networks, the graph generator generates the synthetic minority class node attributes and topological structures, and combined with the graph convolutional network discriminator training, the problem of insufficient sample quality and representativeness in unbalanced time series classification is solved, and the model's identification and classification performance of minority classes is improved.

CN120336952APending Publication Date: 2025-07-18NANJING UNIV OF AERONAUTICS & ASTRONAUTICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510376732.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-27
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

When dealing with the problem of unbalanced time series classification, the prior art fails to fully consider the timing and dynamics of the time series, resulting in insufficient quality and representativeness of the generated samples, and the inability to effectively balance the category distribution, affecting the model's identification ability and classification performance of a few categories.

Method used

The method based on the generation of adversarial graph network is adopted to transform time series classification into graph node classification problems. The potential representation of sequence data is learned through the autoencoder, and the synthetic minority class node attributes and network topology structure are generated using the graph generator, and the training is carried out in combination with the graph convolution network discriminator to enhance the recognition ability of minority classes.

Benefits of technology

It significantly improves the model's identification ability and overall classification performance of a few categories, effectively balances the category distribution, and improves the accuracy of unbalanced time series classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure BSA0000300050330000025
    Figure BSA0000300050330000025
  • Figure BSA0000300050330000027
    Figure BSA0000300050330000027
  • Figure BSA0000300050330000034
    Figure BSA0000300050330000034
Patent Text Reader

Abstract

The invention discloses an unbalanced time sequence classification method based on a generative adversarial graph network, and belongs to the technical field of artificial intelligence. The invention provides a novel and effective solution aiming at the defects existing in the prior art when the unbalanced time sequence classification problem is processed. According to the method, potential representation of sequence data is learned by using an auto-encoder, and a time sequence classification problem is represented as a node classification problem in a graph according to similarity of representation vectors, so that the internal relation between time sequences is better mined, the capture capability of a model on a few types of samples is enhanced, and potential modes and structures in data are disclosed. In order to solve the problem of class imbalance, a graph generator is introduced to generate a synthesized minority class node attribute and a network topology structure so as to balance sample distribution of different classes, and a GCN discriminator is trained to distinguish true and false samples and minority class and majority class samples on a balance graph network so as to realize an imbalance time sequence classification task. And the classification accuracy of minority class samples is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data mining and machine learning, and particularly to an imbalanced time series classification method and system based on a generative adversarial graph network, which is applicable to imbalanced time series data in various scenarios such as medical diagnosis, industrial fault prediction, and financial anomaly detection. Background Art

[0002] In the fields of data mining and machine learning, time series classification (TSC) is a fundamental and important task, which is widely applied in many fields such as medical diagnosis, industrial fault prediction, and financial market analysis. However, in practical applications, time series data often faces the problem of class imbalance, that is, the distribution of the number of samples in different classes is extremely uneven. For example, in medical diagnosis, the number of diseased samples may be much less than that of normal samples; in industrial production, the number of fault samples may be much less than that of normal operation samples. This imbalance will cause traditional classification models to be biased towards the majority class during the training process and ignore the characteristics of the minority class, thus affecting the generalization ability and classification accuracy of the model.

[0003] To solve the problem of class imbalance in time series classification, researchers have proposed various methods. Among them, the data sampling method is one of the most widely used techniques. The undersampling method balances the data distribution by reducing the number of majority class samples, but it may lead to information loss; the oversampling method alleviates the imbalance by increasing the number of minority class samples, but it may cause overfitting problems. In recent years, synthetic oversampling techniques such as SMOTE and its variants have been proposed, which increase the representativeness of the minority class by inserting new synthetic samples between minority class samples. However, when generating new minority class samples, these methods often do not fully consider the temporal and dynamic characteristics of time series data, resulting in the generated samples may deviate from the real data distribution. In addition to the data sampling method, the cost-sensitive learning method assigns different misclassification costs to samples of different classes, making the classifier pay more attention to minority class samples during the training process. However, this method requires prior determination of reasonable cost parameters, and in complex practical applications, the setting of cost parameters is often difficult. Moreover, the ensemble learning method constructs multiple weak classifiers and combines them into a strong classifier to improve the recognition ability of the minority class. For example, methods such as SMOTEBoost and RUSBoost combine oversampling or undersampling techniques with the Boosting algorithm. Although the classification performance is improved to a certain extent, the computational complexity is high, and the efficiency is low when dealing with large-scale datasets.

[0004] Although existing methods have achieved certain results in dealing with class imbalance problems, they usually ignore the unique inherent characteristics of time series data and the complex relationships between sequences. Time series data not only has temporality and dynamics, but also the similarity and difference between sequences are crucial for classification tasks. Traditional methods often regard each time series as an independent sample point and fail to fully utilize the similarity between sequences to enhance the model's recognition and understanding of minority classes. Mining the internal connections between time series can not only enhance the model's ability to capture minority class samples, but also reveal potential patterns and structures in the data, which is of great significance for improving classification accuracy and generalization ability. However, due to the high-dimensionality and variability of time series data, how to effectively represent and utilize the relationships between these sequences, especially in the case of class imbalance, to enhance the capture of minority class information is a highly challenging problem. Summary of the Invention

[0005] Object of the Invention:

[0006] Aiming at the deficiencies of existing technologies in dealing with unbalanced time series classification problems, a novel and effective solution is proposed. In practical applications, due to the complexity of time series data and the widespread existence of class imbalance problems, traditional classification methods often struggle to fully capture the characteristics of minority class samples, resulting in limited classification performance. When generating minority class samples, existing technologies fail to fully consider the temporality and dynamics of time series, leading to insufficient quality and representativeness of the generated samples and unable to effectively balance the class distribution. Therefore, the present invention aims to use an innovative method, based on the principles of graph theory, to fully utilize the internal connections between time series, mine the potential structural information of the data, and at the same time balance the class distribution by generating synthetic samples, thereby significantly improving the model's recognition ability of minority classes and overall classification performance. Through this method, a more adaptable and scalable solution to the unbalanced time series classification problem is provided, enabling it to be widely applied in multiple fields such as medical diagnosis, industrial fault prediction, and financial risk assessment to meet the diverse needs in actual industrial scenarios.

[0007] Technical Solution:

[0008] An unbalanced time series classification method based on a generative adversarial graph network is provided. This method uses an autoencoder to learn the latent representation of sequence data. According to the similarity of the representation vectors, the time series classification is represented as a node classification problem in a graph, and a graph generator is introduced to generate synthetic minority class node attributes and network topologies to balance the node distributions of different classes. The topological structure of the graph is used to generate more realistic minority classes, and a GCN discriminator is trained to distinguish real nodes and pseudo nodes on the balanced network. The method includes the following steps:

[0009] S1. Input the time series data, and assume the time series data is where N is the number of samples;

[0010] S2. Use an autoencoder to encode the input sequence. The weight matrix W between the encoding layer and the input layer, the bias b of the encoding layer nodes m , the bias b of the decoding layer d , and the node activation function g(·). The autoencoder first completes the encoding of the samples through linear mapping and non-linear activation function:

[0011] H = g(WX + b m )

[0012] The decoder completes the decoding of the encoded features to obtain the reconstruction of the input samples The decoding process is similar to the encoding process:

[0013]

[0014] Take the mean squared error as the loss function. For the input sample and the reconstruction its loss function is:

[0015]

[0016] Train the AE to minimize the loss function:

[0017]

[0018] Take the encoding obtained after the final iteration as the latent representation H = [h1, h2,..., h N of the original time series;

[0019] S3. After obtaining the latent representation H = [h1, h2,..., h N of the original time series, calculate the similarity between each representation vector. Here, use cosine similarity for calculation to obtain the similarity matrix S of the representation vectors:

[0020]

[0021] where ‖·‖ is the Euclidean norm of the vector;

[0022] S4. After obtaining the similarity matrix S, construct the graph topological structure. To filter out irrelevant neighbors, only keep the top k neighbors of each node. Specifically, for each row cos(·) in S, only keep the top k entries with the largest values, set them to 1, and set the other entries to 0, thus forming a binary sparse matrix A. Take this matrix as the adjacency matrix of the graph to obtain the unbalanced graph network G im=(V, E, A, X, C), where V represents the set of new nodes, E represents the set of edges, A and X are the adjacency matrix and the feature matrix respectively. The set C represents the set of node labels;

[0023] S5. Construct a graph generator, a fully connected neural network G: Among them, are the network feature space and the network structure space respectively. It aims to generate synthetic minority class node attributes and network topologies. The graph generator takes a noise vector as input and generates minority class node features through a fully connected neural network. The generated node features are similar to the real minority class node feature distribution. At the same time, by generating the adjacency matrix, the connection relationship between the synthetic nodes and the real minority class nodes is established. The output includes the feature matrix and the adjacency matrix of the synthetic minority class nodes. These synthetic data and the real data together form a balanced network for the subsequent training and classification tasks of the GCN discriminator;

[0024] S6. Construct a discriminator, a two-layer graph convolutional network (GCN), which is responsible for distinguishing real nodes from pseudo nodes in the balanced network, and at the same time identifying minority class and majority class nodes. Its input is the balanced network, including the original edges and the edges generated by the generator, as well as the corresponding node feature matrix and adjacency matrix. The discriminator aggregates the information of adjacent nodes through the graph convolutional layer to update the node feature representation, and then applies a non-linear activation function to enhance the model's expressive ability:

[0025]

[0026] In the formula, is a preprocessing step, where I N is the identity matrix, D ij =∑ j A ij . Ω 0 and Ω 1 are the weight matrices input from hidden to hidden and from hidden to output respectively;

[0027] S7. Adversarial training, repeatedly train the generator and the discriminator until the synthetic nodes generated by the generator can effectively simulate the distribution of real minority class nodes, and at the same time the discriminator can correctly distinguish real nodes from pseudo nodes, and minority class nodes from majority class nodes.

[0028] In the method described above, the specific process of the graph generator described in step S5 for generating minority class nodes includes:

[0029] Construct a fully connected neural network as the graph generator, take a noise vector as input, and the output is a set of data that can reflect the network features and topologies, that is Among them, are the network feature space and the network structure space respectively;

[0030] For an unbalanced network G im =(V, E, A, X, C), let n maj and n min represent the number of majority nodes and minority nodes respectively, where n = n maj + n min . Let n g = n maj - n min represent the number of nodes to be generated to balance the network class distribution. Therefore, the number of units in the input layer is d z , and the number of units in the output layer is d o = n g × n min . For better understanding, the output vector is converted into matrix form Then the softmax(·) function is applied to normalize each row in O to the following formula:

[0031]

[0032] In the formula, each row of minority nodes represents the link relationship between each generated minority node and all real minority nodes. In addition, each element T ij represents the normalized weight of the link between the generated node u i ∈ U and the original minority node v j ∈ V, where U is the set of generated minority nodes. Therefore, T represents the network topology structure information between the generated minority nodes and the original minority nodes;

[0033] The node attribute features of the generated minority nodes are obtained by aggregating the attribute features of the real minority class nodes linked to them. To generate the attribute features of the generated nodes the neighbor node attribute features of each generated minority node are aggregated into the following formula:

[0034] X g = TX min

[0035] In the formula, the feature matrix of the real minority nodes of the original unbalanced network G im is and f is the dimension of the original minority node features. Through this operation, the consistency of the generated nodes with the existing network in terms of attributes is ensured.

[0036] In the method described above, the specific process of the discriminator in step S6 for discriminating three types of nodes (majority class, synthetic minority class, real minority class) includes:

[0037] Construct a two - layer GCN as the discriminator. The input of the GCN is a new network \(G'\) with a balanced class distribution obtained by merging a small number of nodes generated by the graph generator into the original unbalanced network \(G\). im The new network \(G'=(V',E',A',X',C')\), where \(V'\) represents the new node set composed of the nodes in \(G\) and a small number of nodes of the minority class generated by the graph generator, \(E'\) represents the new edge set composed of all the edges in \(G\) and the edges generated by the graph generator, \(A'\) and \(X'\) are the new adjacency matrix and feature matrix associated with \(V'\) respectively. The set \(C'=\{(real,minority),(real,majority),(fake,minority)\}\) represents the node label set; bal =(V′,E′,A′,X′,C′), where V′ represents the new node set composed of the nodes in G im and the minority - class nodes generated by the graph generator, E′ represents the new edge set composed of all the edges in G im and the edges generated by the graph generator, A′ and X′ are the new adjacency matrix and feature matrix associated with V′ respectively. The set C′ ={(real,minority), (real,majority), (fake,minority)) represents the node - label set;

[0038] The goal of the discriminator search is to distinguish real nodes on the balanced network from fake nodes introduced by the graph generator, as well as minority - class nodes and majority - class nodes. Therefore, use GCN as a node multi - classifier, and the output \(Y\) of the GCN is calculated as follows:

[0039]

[0040] In the formula, is the pre - processing step, where \(I\) N is the identity matrix, \(D\) ij =\(\sum\) j \(A\) ij . \(\Omega\) 0 and \(\Omega\) 1 are the weight matrices input from hidden to hidden and from hidden to output respectively.

[0041] In the method described above, the specific process of the adversarial training in step S7 includes:

[0042] During the adversarial training process, first randomly initialize the parameters of the generator and the discriminator, and then optimize by alternately training these two networks. In each iteration, first fix the parameters of the generator and only train the discriminator to maximize its loss function so that it can better distinguish real nodes from fake nodes generated by the generator, and identify minority - class and majority - class nodes. Subsequently, fix the parameters of the discriminator and train the generator to minimize its loss function, prompting the generator to generate more realistic minority - class nodes to deceive the discriminator. Update the parameters of the two networks by the gradient - descent method to minimize the total loss;

[0043] Among them, the loss function of the graph generator consists of four parts. The first and second terms are the confusion losses for the discriminator when generating minority - class data. The third term aims to make the generated minority - class nodes close to real minority - class nodes, and the last term is the regularization term:

[0044]

[0045] where \(q\) i \(\in C'\) and represent the true label and the output (predicted probability) of the discriminator respectively, is the node embedding vector, \(\Theta\) is the set of training weights of the graph generator, and \(\alpha\) is the regularization coefficient;

[0046] The loss function of the discriminator also consists of four parts. The first term is the cross-entropy loss for distinguishing whether a node is generated by the generator or a real node in the original network. The second term is the cross-entropy loss for distinguishing whether a node is a minority class or a majority class. The third term aims to keep the embeddings of different class nodes away from each other. The last term is the regularization term:

[0047]

[0048] where \(\Omega\) is the set of training weights of the discriminator and \(\beta\) is the regularization coefficient;

[0049] Finally, the adversarial training objective function of GAGN is:

[0050]

[0051] The goal of the graph generator is to generate fake minority nodes to simulate the distribution of real minority nodes, thus confusing users. The goal of this algorithm is to correctly classify between real training nodes and fake nodes generated from the graph generator, as well as between minority nodes and majority nodes.

[0052] Advantageous effects: Compared with the prior art, the significant effects and substantial features of the present invention mainly lie in:

[0053] (1) A novel graph-based method is proposed to handle the imbalanced time series classification problem. This method transforms the time series classification problem into a graph node classification problem, uses the edges between nodes to represent the associations between time series, fully utilizes the similarity information between time series, and enhances the ability to capture minority class information.

[0054] (2) In the case where the relevant information of the minority class is extremely limited, the construction of the graph effectively captures the high-order association information between time series and more accurately represents the internal pattern of time series data.

[0055] (3) The attributes and network topologies of minority class nodes generated by the graph generator are proposed. By aggregating the features of neighboring nodes, more realistic minority class instances are generated, the node distributions of different classes are balanced, thereby enhancing the model's attention to minority class information and improving the classification performance.

[0056] (4) Comprehensive experiments were carried out on the time series UCR dataset. The results show that this method is superior to existing algorithms in the imbalanced time series classification task, and the effectiveness of this method is verified through ablation studies. Description of the Drawings

[0057] Figure 1 is the workflow diagram of the method described in the present invention;

[0058] Figure 2 is the overall system framework diagram applied by the method described in the present invention. Detailed Embodiments

[0059] To make the objectives, advantages, and technical solutions of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be described completely and clearly below with reference to the accompanying drawings:

[0060] In time series classification, class imbalance is a challenging problem and has received considerable attention in the fields of data mining and machine learning. Imbalanced data refers to the uneven distribution of samples of different classes in the dataset, where the number of samples in some classes is much less than that in other classes. This situation is common in many industrial applications in the real world, such as disease detection in medical diagnosis, fault prediction in industrial production, and anomaly detection in the financial market, etc. This imbalance may cause the model to be biased towards the majority class during the training process and ignore the features of the minority class, maximizing the overall accuracy, thus affecting the generalization ability of the model. Although existing methods have made some progress in dealing with the class imbalance problem, they usually ignore the unique intrinsic characteristics of time series data and the complex relationships between sequences. Time series data not only has temporality and dynamics, but also the similarity and difference between sequences are crucial for the classification task. Traditional methods often regard each time series as an independent sample point and fail to fully utilize the similarity between sequences to strengthen the model's recognition and understanding of the minority class. Mining the internal connections between time series can not only enhance the model's ability to capture minority class samples, but also reveal the potential patterns and structures in the data, which is of great significance for improving the classification accuracy and generalization ability. However, due to the high dimensionality and variability of time series data, how to effectively represent and utilize the relationships between these sequences, especially in the case of class imbalance, to enhance the capture of minority class information, is a very challenging problem.

[0061] What the present invention provides is a new imbalanced time series classification method based on graph generative adversarial networks, aiming to solve the limitations of traditional deep learning methods in dealing with imbalanced datasets. Combining Figure 1 the process shown in Figure 2The method framework diagram shown. In the embodiment, deep neural network technologies such as temporal encoding, graph construction, and graph generative adversarial network are adopted to achieve the classification of unbalanced time series.

[0062] S1. Input the time series data. Let the time series data be where N is the number of samples.

[0063] S2. Encode the input sequence using an autoencoder. The weight matrix W between the encoding layer and the input layer, the bias b of the encoding layer nodes m , the bias b of the decoding layer d , and the node activation function g(·). The autoencoder first completes the encoding of the samples through linear mapping and non-linear activation function:

[0064] H = g(WX + b m )

[0065] The decoder completes the decoding of the encoded features to obtain the reconstruction of the input sample The decoding process is similar to the encoding process:

[0066]

[0067] Take the mean squared error as the loss function. For the input sample and the reconstruction its loss function is

[0068]

[0069] Train the AE to minimize the loss function:

[0070]

[0071] Take the encoding obtained after the final iteration as the latent representation H = [h1, h 2, …, h N of the original time series.

[0072] S3. After obtaining the latent representation H = [h1, h 2, …, h N of the original time series, calculate the similarity between each representation vector. Here, use cosine similarity for calculation to obtain the similarity matrix S of the representation vectors:

[0073]

[0074] In the formula ‖·‖ is the Euclidean norm of the vector.

[0075] S4. After obtaining the similarity matrix S, construct the topological structure of the graph. To filter out irrelevant neighbors, only the top k neighbors of each node are retained. Specifically, for each row cos(·) in S, only the top k entries with the largest values are retained, set to 1, and the other entries are set to 0, thus forming a binary sparse matrix A. This matrix is used as the adjacency matrix of the graph to obtain the unbalanced graph network G im =(V, E, A, X, C), where V represents the set of new nodes, E represents the set of edges, A and X are the adjacency matrix and the feature matrix respectively. The set C represents the set of node labels.

[0076] S5. Construct a fully connected neural network as the graph generator, which takes a noise vector as input and outputs a set of data that can reflect the network features and topological structure, that is where are the network feature space and the network structure space respectively:

[0077] For the unbalanced network G im =(V, E, A, X, C), let n maj and n min represent the number of majority nodes and minority nodes respectively, where n = n maj + n min . Let n g = n maj - n min represent the number of nodes to be generated to balance the network class distribution. Therefore, the number of units in the input layer is d z , and the number of units in the output layer is d o = n g × n min . For better understanding, convert the output vector to matrix form Then apply the softmax(·) function to normalize each row in O to the following formula:

[0078]

[0079] In the formula, each row of minority nodes represents the link relationship between each generated minority node and all real minority nodes. In addition, each element T ij represents the normalized weight of the link between the generated node u i ∈ U and the original minority node v j ∈ V, where U is the set of generated minority nodes. Therefore, T represents the network topological structure information between the generated minority nodes and the original minority nodes:

[0080] The node attribute features of the generated minority nodes are obtained by aggregating the attribute features of the real minority class nodes linked to them. To generate the attribute features of the generated nodes Aggregate the neighbor node attribute features of each generated minority node into the following formula:

[0081] X g = TX min

[0082] In the formula, the feature matrix of the real minority nodes of the original imbalanced network G im is and f is the dimension of the original minority node features. Through this operation, the consistency of the generated nodes with the existing network in terms of attributes is ensured.

[0083] S6. Construct a two-layer GCN as the discriminator. The input of the GCN is a new network G im with a balanced class distribution obtained by merging the minority nodes generated by the graph generator into the original imbalanced network G bal =(V′, E′, A′, X′, C′), where V′ represents the new node set composed of the nodes in G im and the minority class nodes generated by the graph generator, and E′ represents the new edge set composed of all the edges in G im and the edges generated by the graph generator. A′ and X′ are the new adjacency matrix and feature matrix associated with V′ respectively. The set C′ ={(real, minority), (real, majority), (fake, minority)} represents the node label set;

[0084] The goal of the discriminator search is to distinguish real nodes on the balanced network from pseudo nodes introduced by the graph generator, as well as minority class nodes and majority class nodes. Therefore, use GCN as a node multi-classifier, and the output Y of the GCN is calculated as follows:

[0085]

[0086] In the formula is a preprocessing step, where I N is the identity matrix, D ij = ∑ j A ij . Ω 0 and Ω 1 are the weight matrices input from hidden to hidden and from hidden to output respectively.

[0087] S7. During the adversarial training process, first randomly initialize the parameters of the generator and discriminator, and then optimize by alternately training these two networks. In each iteration, first fix the parameters of the generator and only train the discriminator to maximize its loss function, enabling it to better distinguish real nodes from the fake nodes generated by the generator, as well as identify minority-class and majority-class nodes. Subsequently, fix the parameters of the discriminator and train the generator to minimize its loss function, prompting the generator to generate more realistic minority-class nodes to deceive the discriminator. Update the parameters of the two networks by the gradient descent method to minimize the total loss;

[0088] The loss function of the graph generator consists of four parts. The first and second terms are the confusion losses for the discriminator when generating minority-class data. The third term aims to make the generated minority-class nodes close to real minority-class nodes, and the last term is the regularization term:

[0089]

[0090] where q i ∈ C′ and represent the true label and the output (predicted probability) of the discriminator respectively, is the node embedding vector, Θ is the set of training weights of the graph generator, and ɑ is the regularization coefficient;

[0091] The loss function of the discriminator also consists of four parts. The first term is the cross-entropy loss for distinguishing whether a node is generated by the generator or a real node in the original network. The second term is the cross-entropy loss for distinguishing whether a node is a minority class or a majority class. The third term aims to keep the embeddings of different-class nodes away from each other. The last term is the regularization term:

[0092]

[0093] where Ω is the set of training weights of the discriminator and β is the regularization coefficient:

[0094] Finally, the adversarial training objective function of GAGN is:

[0095]

[0096] The goal of the graph generator is to generate fake minority nodes to simulate the distribution of real minority nodes, thus confusing users, so as to achieve correct classification between real training nodes and fake nodes generated by the graph generator, as well as correct classification between minority nodes and majority nodes.

Claims

1. An unbalanced time series classification method based on a generative adversarial graph network. This method uses an autoencoder to learn the latent representation of sequence data. According to the similarity of the representation vectors, the time series classification is represented as a node classification problem in a graph, and a graph generator is introduced to generate synthetic minority class node attributes and network topologies to balance the node distributions of different classes. The topological structure of the graph is used to generate more realistic minority classes, and a GCN discriminator is trained to distinguish real nodes and pseudo nodes on the balanced network. The method includes the following steps: S1. Input the time series data, and assume the time series data is where N is the number of samples; S2. Use an autoencoder to encode the input sequence. The weight matrix W between the encoding layer and the input layer, the bias b of the encoding layer nodes m , the bias b of the decoding layer d , the node activation function g(·). The autoencoder first completes the encoding of the samples through linear mapping and non-linear activation functions: H = g(WX + b m ) The decoder completes the decoding of the encoded features to obtain the reconstruction of the input samples The decoding process is similar to the encoding process: Take the mean squared error as the loss function. For the input samples and the reconstruction its loss function is as follows: Train the AE to minimize the loss function: Take the encoding obtained after the final iteration as the latent representation H = [h1, h2,... h N of the original time series; S3. After obtaining the latent representation H = [h1, h 2, ..., h N of the original time series, calculate the similarity between each pair of representation vectors. Here, the cosine similarity is used for calculation to obtain the similarity matrix S of the representation vectors: where ||·|| is the Euclidean norm of a vector; S4. After obtaining the similarity matrix S, construct the topological structure of the graph. To filter out irrelevant neighbors, only the top k neighbors of each node are retained. Specifically, for each row cos(·) in S, only the top k entries with the largest numerical values are retained, set to 1, and the other entries are set to 0, thus forming a binary sparse matrix A. This matrix is used as the adjacency matrix of the graph to obtain the unbalanced graph network G im =(V, E, A, X, C), where V represents the set of new nodes, E represents the set of edges, and A and X are the adjacency matrix and the feature matrix respectively. The set C represents the set of node labels; S5. Construct a graph generator, which is a fully connected neural network Among them, They are the network feature space and the network structure space respectively. The aim is to generate synthetic minority-class node attributes and network topologies. The graph generator takes a noise vector as input and generates minority-class node features through a fully connected neural network. The generated node features are similar to the distribution of real minority-class node features. At the same time, by generating an adjacency matrix, the connection relationship between the synthetic nodes and the real minority-class nodes is established. The output includes the feature matrix and the adjacency matrix of the synthetic minority-class nodes. These synthetic data and the real data together form a balanced network, which is used for the subsequent training and classification tasks of the GCN discriminator; S6. Construct a discriminator, a two-layer graph convolutional network (GCN), which is responsible for distinguishing real nodes and pseudo nodes in the balanced network, and at the same time identifying minority class and majority class nodes. Its input is the balanced network, including the original edges and the edges generated by the generator, as well as the corresponding node feature matrix and adjacency matrix. The discriminator aggregates the information of adjacent nodes through the graph convolutional layer to update the node feature representation, and then applies a non-linear activation function to enhance the model's expressive ability: In the formula, is a preprocessing step, where I N is the identity matrix, D ij = ∑ j A ij . Ω 0 and Ω 1 are the weight matrices input from hidden to hidden and from hidden to output, respectively; S7. Adversarial training, repeatedly train the generator and the discriminator until the synthetic nodes generated by the generator can effectively simulate the distribution of real minority class nodes, and at the same time the discriminator correctly distinguishes real nodes and pseudo nodes, as well as minority class nodes and majority class nodes.

2. The unbalanced time series classification method based on a generative adversarial graph network according to claim 1, wherein The specific process of step S5 includes: Construct a fully connected neural network as a graph generator that takes a noise vector as input and outputs a set of data that can reflect the network's features and topological structure, namely where are the network feature space and the network structure space respectively; For an unbalanced network G im =(V, E, A, X, C), let n maj and n min represent the number of majority nodes and minority nodes respectively, where n = n maj + n min . Let n g = n maj - n min represent the number of nodes to be generated to balance the network class distribution. Thus, the number of units in the input layer is d z , and the number of units in the output layer is d o = n g × n min . For better understanding, convert the output vector to matrix form Then apply the softmax(·) function to normalize each row in O to the following formula: In the formula, the few nodes in each row represent the link relationship between each generated few node and all real few nodes. In addition, each element T ij represents the generated node u i ∈ U and the original few node v j ∈ V, where U is the set of generated few nodes. Therefore, T represents the network topology information between the generated few nodes and the original few nodes; The node attribute features of the generated minority nodes are obtained by aggregating the attribute features of the true minority class nodes linked to them. In order to generate the attribute features of the generated nodes Aggregate the neighbor node attribute features of each generated minority node into the following formula: X g = TX min where the original unbalanced network is G im and the feature matrix of the true minority nodes is where f is the dimension of the features of the original minority nodes. Through this operation, the consistency in attributes between the generated nodes and the existing network is ensured.

3. The unbalanced time series classification method based on a generative adversarial graph network according to claim 1, wherein The specific process of step S6 includes: A two-layer GCN is constructed as the discriminator, and the input is a few nodes generated by the graph generator merged into the original unbalanced network G im The new network G with balanced class distribution is obtained bal =(V′, E′, A′, X′, C′), where V′ represents the im The new node set consists of the nodes in G and the minority class nodes generated by the graph generator. E′ represents the node set composed of im The new edge set consists of all the edges in and the edges generated by the graph generator. A′ and X′ are the new adjacency matrix and feature matrix associated with V′ respectively. The set C′={(real, minority), (real, majority), (fake, minority)} represents the node label set; The goal of the discriminator search is to distinguish real nodes on the balanced network from pseudo nodes introduced by the graph generator, as well as minority class nodes and majority class nodes. Therefore, use GCN as a node multi-classifier, and the output Y of GCN is calculated as follows: In the formula, is a preprocessing step, where I N is the identity matrix, D ij = ∑ j A ij . Ω 0 and Ω 1 are the weight matrices input from hidden to hidden and from hidden to output respectively.

4. The unbalanced time series classification method based on a generative adversarial graph network according to claim 1, wherein The specific process of step S7 includes: During the adversarial training process, first randomly initialize the parameters of the generator and the discriminator, and then optimize by alternately training these two networks. In each iteration, first fix the parameters of the generator and only train the discriminator to maximize its loss function so that it can better distinguish real nodes and pseudo nodes generated by the generator, as well as identify minority class and majority class nodes. Subsequently, fix the parameters of the discriminator and train the generator to minimize its loss function, prompting the generator to generate more realistic minority class nodes to deceive the discriminator. Update the parameters of the two networks by the gradient descent method to minimize the total loss; Among them, the loss function of the graph generator consists of four parts. The first and second terms are the confusion losses for the discriminator when generating minority class data. The third term aims to make the generated minority class nodes close to real minority class nodes, and the last term is the regularization term: where q i ∈ C′ and represent the true label and the output (predicted probability) of the discriminator respectively, is the node embedding vector, Θ is the set of training weights of the graph generator, and ɑ is the regularization coefficient; The loss function of the discriminator also consists of four parts. The first term is the cross-entropy loss for distinguishing whether a node is generated by the generator or a real node in the original network. The second term is the cross-entropy loss for distinguishing whether a node is a minority class or a majority class. The third term aims to make the embeddings of different class nodes far away from each other. The last term is the regularization term: In the formula, Ω is the set of training weights of the discriminator, and β is the regularization coefficient; Finally, the adversarial training objective function of GAGN is: The goal of the graph generator is to generate fake minority nodes to simulate the distribution of real minority nodes, thus confusing users. The goal of the algorithm is to correctly classify between real training nodes and fake nodes generated from the graph generator, as well as correctly classify between minority nodes and majority nodes.

5. The unbalanced time series classification method based on a generative adversarial graph network according to claim 1, characterized in that Use an autoencoder to learn the latent representation of sequence data. According to the similarity of the representation vectors, represent the time series classification problem as a node classification problem in a graph, so as to better mine the internal connections between time series, enhance the model's ability to capture minority class samples, and reveal the potential patterns and structures in the data. To address the class imbalance problem, a graph generator is introduced to generate synthetic minority class node attributes and network topologies to balance the node distributions of different classes, and a GCN discriminator is trained to distinguish real nodes and pseudo nodes on the balanced graph network.