An unbalanced graph node classification method and system based on boundary node conditional GAN
By employing a boundary node conditional GAN approach, which utilizes class and topological information for conditional adversarial training, the classification problem of graph neural networks in imbalanced data is solved, improving the embedding representation of minority class samples and the overall classification accuracy.
Patent Information
- Application Number
- CN202510104523.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-23
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2045-01-23
AI Technical Summary
Existing graph neural network models struggle to effectively balance majority and minority class samples when dealing with imbalanced graph structure data, resulting in poor classification results.
We adopt a boundary node-based conditional GAN approach, using class information and contextual topology information as conditional inputs. Through conditional adversarial training, we utilize graph convolutional networks for node classification, thereby enhancing the learning ability of the classifier.
By fully utilizing the topological information in graph-structured data, the distance between categories is increased, improving the embedding representation of minor class samples in the graph neural network model and enhancing the overall classification results.
Smart Images

Figure CN120045762B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, and in particular to an unbalanced graph node classification method and system based on boundary node conditional GAN. BACKGROUND
[0002] As graph structure data is very common in the real world, almost all complex systems can be naturally represented as graph structure, such as social networks, financial networks, and protein interaction networks. In recent years, graph neural networks (GNNs) have received more and more attention and research. Unlike traditional deep learning models that process regular grid data, GNNs focus on capturing and learning the complex relationships and topological structures between nodes in a graph. Through an iterative process of information transmission and aggregation, GNNs enable each node representation to gradually focus on relevant information to obtain effective information representation and handle various graph learning tasks such as node classification.
[0003] However, most current GNNs models are implicitly trained based on complete data state, assuming that graph data can provide sufficient information. Due to the diverse distribution of real data, nodes are inherently class imbalanced, and the implicit assumption does not hold in many practical situations, such as the number of high-risk enterprises in a financial knowledge network being much smaller than the number of normal enterprises. When the number of samples of the majority class in the training set is much larger than that of the minority class, researchers believe that machine learning models are prone to insufficient representation of the minority class, resulting in poor overall classification results. Therefore, this imbalance inevitably hinders the training of expressive graph neural network models on these limited information graph data. How to balance the majority and minority class samples in the node classification task of graph structure data is the key to the research and implementation of class imbalanced graph data node classification methods. SUMMARY
[0004] To solve the above technical problems existing in the prior art, the present application proposes an unbalanced graph node classification method and system based on boundary node conditional GAN, which inputs class information and context topological information as conditions into conditional GAN for conditional adversarial training, fully utilizes the rich topological information in graph structure data ignored by traditional class imbalance learning methods, and promotes the learning of the classifier.
[0005] In one aspect, to achieve the above object, the present application provides an unbalanced graph node classification method based on boundary node conditional GAN, comprising:
[0006] constructing a graph structure data set to be classified;
[0007] inputting the graph structure data set to be classified into a graph convolution network for node classification for processing, and outputting a classification result; wherein the graph convolution network for node classification is trained by a training data set and obtained according to a convolution layer parameter obtained by training, and the training set is a graph structure data set.
[0008] Preferably, the graph convolution network for node classification is obtained by:
[0009] inputting the training data set into a neural network GCN structure containing two layers of graph convolution, and obtaining an embedding vector of an original node in the data set;
[0010] calculating an uncertainty score of each node according to the embedding vector of each node, and performing balance calibration to obtain a node misclassification risk rate, and obtaining a decision boundary node set based on the node misclassification risk rate;
[0011] inputting the boundary node into a condition generator, and using a multilayer perceptron to encode the input node according to an input condition label and structure, and outputting a synthetic node;
[0012] inputting the original node embedding and the synthetic node into a condition discriminator, and using a multilayer perceptron to conditionally encode the synthetic node and the original node according to an input condition label and structure, and outputting two discriminator feedback values reflecting the true and false degrees of the synthetic node and the original node;
[0013] setting a model optimizer, calculating a classification loss of the GCN, calculating a target loss function of the generator, updating parameters of the condition generator according to a parameter gradient calculated in a reverse direction of the target loss function of the generator, calculating a target loss function of the condition discriminator, updating the condition discriminator according to a parameter gradient calculated in a reverse direction of the target loss function of the condition discriminator, and updating parameters of a convolution layer of the GCN in combination with a parameter gradient calculated in a reverse direction of the classification loss;
[0014] obtaining the graph convolution network for node classification trained according to the convolution layer parameter obtained by training, i.e., the graph convolution network for node classification.
[0015] Preferably, the embedding vector of the original node is obtained by:
[0016] inputting the graph structure data set into a first graph convolution layer of the GCN, and obtaining a first graph convolution vector;
[0017] inputting the first graph convolution vector into an activation function, and obtaining an activation vector;
[0018] inputting the activation vector into a second graph convolution layer, and obtaining the embedding vector of the original node.
[0019] Preferably, the decision boundary node set is obtained by:
[0020] Based on the embedding vector of each original node, the node uncertainty score is calculated using Kullback-Leibler divergence, and the node uncertainty score is balanced and calibrated to obtain the final misclassification risk rate of the node.
[0021] The top K% of nodes are obtained by using the final misclassification risk rate of the nodes, thus obtaining the decision boundary node set;
[0022] The uncertainty score of the node is calculated as follows:
[0023]
[0024] In the formula, o v Let o be the embedding vector of node v. v (j) =P(y v =C j |G); C is the category label distribution set, C j Let U be the set of nodes of class j, and |C| be the total number of classes; v For the uncertain score of node v, D KL The function representing the KL calculation. Represents a single-point distribution The value of the category, The predicted label for node v;
[0025] The final misclassification risk rate of the node is:
[0026]
[0027] In the formula, r v For the final misclassification risk rate, for The number of class nodes in the training set; R imb This represents the imbalance ratio of the training set.
[0028] Preferably, the output of the synthesized node includes:
[0029] The condition labels are mapped to condition vector one using one-hot encoding, and the context information of the nodes is integrated and mapped to condition vector two as a condition structure.
[0030] The noise z is obtained by Gaussian perturbation. The noise z is concatenated with the first conditional vector and the second conditional vector and then learned by a standard multilayer perceptron to be converted into a fake sample similar to the real sample. The synthetic node is then output.
[0031] Among them, the conditional structure information TI of the node v The formal expression is obtained as follows:
[0032]
[0033] where N(v) denotes the neighborhood nodes of node v, O u denotes the original node embedding of node u.
[0034] Preferably, obtaining the discriminator feedback value comprises:
[0035] mapping the synthetic sample outputted by the conditional generator and the original node embedding to the conditional label corresponding to the original node as vectors h g and h r , respectively.
[0036] performing weighted summation by convolution, and outputting the discriminator feedback value reflecting the true or false degree of the synthetic sample g outputted by the conditional generator and the real node, respectively.
[0037] Preferably, the target loss function of the generator is:
[0038]
[0039] where L G is the target loss function of the conditional generator, V R is the set of decision boundary nodes, Z i is the noise vector of the i-th node, y i is the conditional label of the i-th node, D(G(z i |(y i , TI i )|y i ) is the real discrimination probability of the generated node by the discriminator.
[0040] The target loss function of the conditional discriminator is:
[0041]
[0042] where L D is the target loss function of the conditional discriminator, D(x i |y i ) is the discrimination probability of the real node as class y i by the discriminator, and 1-D(G(z i |(y i , TI i )|y i ) is the non-real discrimination probability of the generated node by the discriminator.
[0043] The loss of the GCN is:
[0044] L = aL gcn +(1-a)L D;
[0045] In the formula, L is a GCN loss, L gcn is a classification loss of the GCN, and a is a weight value.
[0046] In another aspect, to achieve the above object, the application further provides an unbalanced graph node classification system based on a boundary node conditional GAN, comprising:
[0047] A data acquisition module is configured to construct a graph structure data set to be classified.
[0048] A model training module is configured to input the graph structure data set to be classified into a graph convolution network for node classification for processing and output a classification result; wherein the graph convolution network for node classification is trained by a training data set and is obtained according to convolution layer parameters obtained by training, and the training set is a graph structure data set.
[0049] Preferably, the model training module comprises:
[0050] A boundary node evaluation unit is configured to calculate an uncertainty score of each node according to an embedding vector of each node, perform balance calibration, obtain a node misclassification risk rate, and obtain a decision boundary node set based on the node misclassification risk rate.
[0051] A condition generator unit is configured to input a boundary node into a condition generator, encode an input node according to an input condition label and structure by using a multilayer perceptron, and output a synthetic node.
[0052] A condition discriminator unit is configured to input an original node embedding and a synthetic node into a condition discriminator, respectively conditionally encode the input synthetic node and a real node according to an input condition label and structure by using a multilayer perceptron, input the discriminator, and obtain a feedback value.
[0053] A model updating unit is configured to update the conditional generative adversarial network model based on the feedback value until a loss function converges.
[0054] A model prediction unit is configured to classify and predict the graph structure data set to be classified according to the trained classification model.
[0055] The application further provides an electronic device comprising a processor, a memory, and a program or instructions stored on the memory and executable on the processor, wherein the program or instructions are executed by the processor to implement the steps of the unbalanced graph node classification method based on the boundary node conditional GAN.
[0056] Compared with the prior art, the application has the following advantages and technical effects:
[0057] Compared with traditional class imbalance learning methods, the method provided in the application is based on a graph neural network, class information and context topological information are input as conditions into a conditional GAN for conditional adversarial training, the rich topological information in the graph structure data ignored by traditional class imbalance learning methods is fully utilized, and learning of the classifier is promoted; the application applies an adversarial network training process to class decision boundary nodes, expands the distance between classes, and enables the graph neural network model to better learn node embedding, and in the case that no noise node is introduced into the original graph, the problem of poor overall classification result caused by insufficient small class embedding representation is overcome. BRIEF DESCRIPTION OF DRAWINGS
[0058] The accompanying drawings, which form a part of this application, are included to provide a further understanding of the application and are incorporated in and constitute a part of this application. The embodiments of this application, and of the description of these embodiments, are used to explain the application and are not intended to limit the application. In the drawings:
[0059] Figure 1 A flow chart of an imbalance graph node classification method based on boundary node conditional GAN for an embodiment of the application;
[0060] Figure 2 A conditional generator framework diagram for an embodiment of the application;
[0061] Figure 3 A conditional discriminator framework diagram for an embodiment of the application;
[0062] Figure 4 A model update framework diagram for an embodiment of the application;
[0063] Figure 5 A structural schematic diagram of an imbalance graph node classification system based on boundary node conditional GAN for an embodiment of the application;
[0064] Figure 6 A result block diagram of an electronic device for an embodiment of the application. DETAILED DESCRIPTION
[0065] It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0066] It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a group of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown herein.
[0067] The application provides an imbalance graph node classification method based on boundary node conditional GAN, as shown in Figure 1 , comprising:
[0068] Construct a graph-structured dataset to be classified;
[0069] The graph structure dataset to be classified is input into a graph convolutional network for node classification for processing, and the classification result is output. The graph convolutional network for node classification is trained using a training dataset and obtained based on the convolutional layer parameters obtained during training. The training set is a graph structure dataset.
[0070] Further, obtaining the graph convolutional network for node classification includes:
[0071] Step 1: Obtain the graph source data (i.e., the training dataset) and construct the graph structure dataset G = (V, E, X, C); where V = {v1, v2, ..., v...} n} is a set containing n nodes; E = {e 1,2 ,e 1,3 ,…,e n-1,n} is the set of edges that are equivalent to an n×n adjacency matrix A, if e i,j ∈E, then A ij =1, otherwise A ij =0; It is a matrix containing n nodes and their associated features. Graph G has multiple classes, which divide G into |C| clusters, denoted by C = {C1, C2, ..., C}. |C| The cluster} represents nodes in each cluster having the same label, and the node label information in G is represented as Y. The class distribution may be highly skewed because one or more classes contain more nodes than other classes, i.e., |C1| >> |C2|. In this case, C1 belongs to the majority class, and C2 belongs to the minority class.
[0072] Step 2: Input the data of G into the two-layer GCN to obtain the embedding vector O of the original node;
[0073] Step 3: For each node, calculate its uncertainty score based on the original embedding vector and perform balance calibration to obtain the node misclassification risk rate and obtain the decision boundary node set;
[0074] Step 4: Input the boundary node set into the condition generator. The condition generator uses a multilayer perceptron to encode the input nodes according to the input condition labels and structure, and outputs the condition generation embedding of the synthesized node g, so that the synthesized node g has the style features represented by the condition label y' and the structural features of the input nodes.
[0075] Step 5: input the original node original embedding and the conditional generation embedding of the synthetic node into a conditional discriminator, the conditional discriminator uses a multi-layer perception to respectively conditionally encode the input synthetic node g and the real node v according to the input conditional label and structure, and inputs two discriminator feedback values reflecting the true and false degrees of the synthetic node g and the real node v;
[0076] Step 6: set a model updating module, calculate the classification loss of the GCN, calculate the target loss function of the generator, update the parameters of the conditional generator according to the parameter gradient calculated by the loss function in reverse, calculate the target loss function of the conditional discriminator, and update the parameters of the conditional discriminator and the GCN convolution layer according to the parameter gradient calculated by the loss function in reverse;
[0077] Step 7: according to the trained convolution layer parameters, obtain the GCN used for node classification, and input the data to be classified into the GCN to obtain the prediction of the data to be classified.
[0078] Specifically, the embedding vector of the original node is obtained, including:
[0079] The graph structure data set is input into the first graph convolution layer of the GCN to obtain a first graph convolution vector;
[0080] The first graph convolution vector is input into an activation function to obtain an activation vector;
[0081] The activation vector is input into a second graph convolution layer to obtain the embedding vector of the original node.
[0082] The calculation method is as follows:
[0083]
[0084] Wherein, is a feature transformation matrix, X is a node feature matrix, W 0 , W 1 are respectively the first and second trainable weight matrices, and sigma is an activation function; A is an adjacency matrix, I is an identity matrix, and D is a degree matrix of A.
[0085] Specifically, the decision boundary node set in step 3 is obtained, including:
[0086] According to the embedding vector of each original node, the node uncertainty score is calculated by Kullback-Leibler divergence, and the node uncertainty score is balanced and calibrated to obtain the final misclassification risk rate of the node;
[0087] The top K% nodes are obtained through the final misclassification risk rate of the node to obtain the decision boundary node set; wherein K is a hyperparameter.
[0088] Wherein, the node uncertainty score is calculated as follows:
[0089]
[0090] In the formula, o v Let o be the embedding vector of node v. v (j) =P(y v =C j |G); C is the category label distribution set, C j Let U be the set of nodes of class j, and |C| be the total number of classes; v For the uncertain score of node v, D KL The function representing the KL calculation. Indicate target category Single-point distribution, Represents a single-point distribution The value of the category, The predicted label for node v;
[0091] The final misclassification risk rate of the obtained node is:
[0092]
[0093] In the formula, r v For the final misclassification risk rate, for The number of class nodes in the training set; R imb This represents the imbalance ratio of the training set.
[0094] Step 4 specifically includes:
[0095] Step 4.1: Map the condition label y to condition vector one using one-hot encoding, and integrate the node context information as a condition structure to map to condition vector two;
[0096] Step 4.2: Obtain noise z through Gaussian perturbation, concatenate z with conditional vector one and conditional vector two, and then learn it through a standard multilayer perceptron to convert it into a fake sample that resembles the real sample.
[0097] Specifically, refer to Figure 2 In the boundary node-based condition generator, the label y of the boundary node v is... v One-hot mapping is used to obtain conditional vector one: one-hot(y v The context information of the boundary node v is integrated as conditional structure information and mapped to conditional vector two: TI v .
[0098] TI v The calculation method is as follows:
[0099]
[0100] where N(v) denotes the neighborhood nodes of node v, O u denotes the original node embedding of node u;
[0101] Then, according to the Gaussian perturbation, noise z is obtained, and z is concatenated with the conditional vector one and the conditional vector two, and then the standard multi-layer perception learning is used to obtain the synthetic nodes similar to the real nodes as the fake samples. The formal expression of the fake samples obtained by the input boundary node v is as follows:
[0102] g v = MLP(z||one-hot(y v )||TI v ).
[0103] The feedback value obtained in step 5 includes:
[0104] The synthetic samples output by the conditional generator and the original node embedding are respectively mapped to vectors h g and h r corresponding to the conditional labels of the original nodes.
[0105] The convolution is used for weighted summation, and the discriminator feedback values reflecting the true and false degrees of the synthetic samples g output by the conditional generator and the real nodes are output.
[0106] Specifically, referring to Figure 3 , in the conditional discriminator based on the boundary node, the input boundary node v obtains the fake sample g v and the embedding vector o v of the node v, which are respectively mapped to vectors h g and h r corresponding to the conditional labels y; h g and h r are subjected to one convolution weighted summation and output the discriminator feedback value reflecting the true and false degrees of the nodes.
[0107] Further, in step 6, it includes:
[0108] The model optimizer is set, the classification loss of the GCN is calculated; the target loss function of the generator is calculated, the parameter gradient updated according to the target loss function of the generator is used to update the parameters of the conditional generator; the target loss function of the conditional discriminator is calculated, the parameter gradient updated according to the target loss function of the conditional discriminator is used to update the conditional discriminator; the parameter gradient updated according to the classification loss of the GCN is used to update the parameters of the GCN convolution layer.
[0109] Specifically, referring to Figure 4 , in the model updater, the fake samples generated by the conditional generator are close to the real data distribution and match the given class labels, so the loss function LG The parameters of the conditional generator are updated by back-calculating the parameter gradient using the calculated loss function.
[0110] L G The calculation method is as follows:
[0111]
[0112] In the formula, L G V is the target loss function of the condition generator. R For the decision boundary node set, z i Let y be the noise vector of the i-th node. i Let D(G(z) be the condition label for the i-th node. i |(y i TI i )|y i ) represents the true discrimination probability of the discriminator for the generated node;
[0113] The conditional discriminator needs to classify fake and real samples generated by the condition generator. A well-trained classifier is required to distinguish between real and fake samples, and the loss function L of the conditional discriminator needs to be calculated. D The parameters of the conditional discriminator are updated using the parameter gradients calculated in reverse using its loss function. D The calculation method is as follows;
[0114]
[0115] Where D(x) i |y i ) is the discriminator classifying real nodes as category y. i The discrimination probability, 1-D(G(z) i |(y i TI i )|y i ) is the probability that the discriminator classifies the generated node as "non-real".
[0116] Generative Neural Networks (GCNs) are the foundational model for graph node classification, requiring a well-trained classifier to distinguish between different categories of samples. This embodiment enhances the expressive power of the GCN through generative adversarial training between a conditional generator and a conditional discriminator. Therefore, the classification loss L of the GCN is calculated. gcn , will L gcn and L D These are combined to form the GCN loss L, which is formally expressed as shown in the equation. The parameters of the GCN convolutional layers are updated using the parameter gradients calculated by backpropagation of L.
[0117]
[0118] L=αL gcn+(1-α)L D ;
[0119] By fixing the GCN model parameters obtained through the above training, the data to be classified is input into the fixed GCN to obtain the classification result of the data to be classified.
[0120] This embodiment also provides an imbalanced graph node classification system based on boundary node conditional GAN, such as Figure 5 ,include:
[0121] Data acquisition module: used to construct the graph structure dataset to be classified;
[0122] Model training module: used to input the graph structure dataset to be classified into a graph convolutional network for node classification for processing and output classification results; wherein, the graph convolutional network for node classification is trained using a training dataset and obtained based on the convolutional layer parameters obtained during training, and the training set is a graph structure dataset.
[0123] The model training module includes:
[0124] Boundary node evaluation unit: used to calculate the uncertainty score of each node based on the embedding vector of each node, perform balance calibration, obtain the node misclassification risk rate, and obtain the decision boundary node set based on the node misclassification risk rate;
[0125] Condition generator unit: Used to input boundary nodes into the condition generator, and use a multilayer perceptron to encode the input nodes according to the input condition labels and structure, and output the synthesized nodes;
[0126] Conditional discriminator unit: used to input the original embedded nodes and synthetic nodes into the conditional discriminator, and to use a multilayer perceptron to conditionally encode the input synthetic nodes and real nodes according to the input conditional labels and structures, input them into the discriminator, and obtain feedback values;
[0127] Model update unit: used to update the conditional generative adversarial network model based on the feedback value until the loss function converges;
[0128] Model prediction unit: Used to perform classification prediction on the graph structure dataset to be classified based on the trained classification model.
[0129] This embodiment provides an electronic device, such as... Figure 6 It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein when the program or instructions are executed by the processor, they implement the steps of an imbalanced graph node classification method based on boundary node conditional GAN.
[0130] The following examples illustrate this technical solution using financial risk classification:
[0131] Embodiment one,
[0132] An unbalanced graph node classification method based on boundary node conditional GAN, running on an electronic device, applied to financial risk classification, to solve the problem of uneven distribution of financial entity risk categories in risk classification, including the following steps:
[0133] Step 1: Obtain financial risk graph source data, obtain financial entities, including companies, characters (natural persons), regulatory agencies, industries, etc.; Obtain financial relationships, including company-to-company relationships, company-to-industry relationships, company-to-person relationships, etc.; Obtain calculation features, including market data, financial statements, etc. Higher frequency, properties used for statistical calculation. Financial entities, relationships and features are constructed into graph data form. Construct graph structure data set G=(V,E,X,C); Where V={v1,v2,…,v n} is a set containing n nodes; E={e 1,2 ,e 1,3 ,…,e n-1,n} is a set of edges that can be equivalent to an adjacency matrix A of n x n, if e i,j ∈E, then A ij =1, otherwise A ij =0; is a matrix containing n nodes and their associated features. Graph G has multiple classes, which divide G into |C| clusters, denoted by C={C1,C2,…,C |C|}. The nodes in each cluster have the same label, and the node label information in G is represented as Y. The class distribution may be highly skewed, as one or more classes contain more nodes than other classes, i.e. |C1|>>||C2|. In this case, C1 belongs to the majority class, and C2 belongs to the minority class.
[0134] Step 2: Input the data of G into a two-layer GCN to obtain the original node embedding vector;
[0135] Step 3: For each node, calculate its uncertainty score based on the original embedding vector and perform balance calibration to obtain the node misclassification risk rate, and obtain the decision boundary node set;
[0136] Step 4: Input the boundary node set into the conditional generator, which uses a multi-layer perceptron to encode the input nodes based on the input conditional label and structure, and outputs the conditional generation embedding of the synthesized node g, so that the synthesized node g has the style features represented by the conditional label y' and the structural features of the input node;
[0137] Step 5: input the original node original embedding and the conditional generation embedding of the synthetic node into a conditional discriminator, the conditional discriminator uses a multi-layer perception to respectively conditionally encode the input synthetic node g and the real node v according to the input conditional label and structure, and inputs two discriminator feedback values reflecting the true and false degrees of the synthetic node g and the real node v;
[0138] Step 6: set a model updating module, calculate the classification loss of the GCN, calculate the target loss function of the generator, update the parameters of the conditional generator according to the parameter gradient calculated by the loss function in reverse, calculate the target loss function of the conditional discriminator, and update the parameters of the conditional discriminator and the GCN convolution layer according to the parameter gradient calculated by the loss function in reverse;
[0139] Step 7: according to the trained convolution layer parameters, obtain the GCN used for node classification, and input the data to be classified into the GCN to obtain the prediction of the data to be classified.
[0140] Specifically, the embedding vector of the original node is obtained, including:
[0141] The graph structure data set is input into the first graph convolution layer of the GCN to obtain a first graph convolution vector;
[0142] The first graph convolution vector is input into an activation function to obtain an activation vector;
[0143] The activation vector is input into a second graph convolution layer to obtain the embedding vector of the original node.
[0144] The calculation method is as follows:
[0145]
[0146] Wherein, is a feature transformation matrix, X is a node feature matrix, W 0 , W 1 are respectively the first and second trainable weight matrices, and sigma is an activation function; A is an adjacency matrix, I is an identity matrix, and D is a degree matrix of A.
[0147] Specifically, the decision boundary node set in step 3 is obtained, including:
[0148] According to the embedding vector of each original node, the node uncertainty score is calculated by Kullback-Leibler divergence, and the node uncertainty score is balanced and calibrated to obtain a final misclassification risk rate of the node;
[0149] The top K% nodes are obtained through the final misclassification risk rate of the node to obtain the decision boundary node set; wherein K is a hyperparameter.
[0150] Wherein, the node uncertainty score is calculated as follows:
[0151]
[0152] In the formula, o v Let o be the embedding vector of node v. v (j) =P(y v =C j |G); Let C be the predicted label for node v, and C be the distribution set of class labels. j Let U be the set of nodes of class j, and |C| be the total number of classes; v For the uncertain score of node v, D KL The function representing the KL calculation, in this embodiment, is for the category Its value is 1 for the first category and 0 for the second category. Represents a single-point distribution The value of the category;
[0153] The final misclassification risk rate of the node is:
[0154]
[0155] In the formula, r v For the final misclassification risk rate, for The number of class nodes in the training set; R imb This represents the imbalance ratio of the training set.
[0156] Step 4 specifically includes:
[0157] Step 4.1: Map the condition label y to condition vector one using one-hot encoding, and integrate the node context information as a condition structure to map to condition vector two;
[0158] Step 4.2: Obtain noise z through Gaussian perturbation, concatenate z with conditional vector one and conditional vector two, and then learn it through a standard multilayer perceptron to convert it into a fake sample that resembles the real sample.
[0159] Specifically, refer to Figure 2 In the boundary node-based condition generator, the label y of the boundary node v is... v One-hot mapping is used to obtain conditional vector one: one-hot(y v The context information of the boundary node v is integrated as conditional structure information and mapped to conditional vector two: TI v .
[0160] TI v The calculation method is as follows:
[0161]
[0162] where N(v) represents the neighborhood nodes of node v, o u represents the original node embedding of node u;
[0163] Then, according to the Gaussian disturbance, noise z is obtained, z is concatenated with the conditional vector one and the conditional vector two, and a standard multi-layer perception learning is performed to obtain a synthetic node similar to the real one as a fake sample. The formal expression of the fake sample obtained for the input boundary node v is as follows:
[0164] g v = MLP(z||one-hot(y v )||TI v ).
[0165] The feedback value obtained in step 5 includes:
[0166] The synthetic sample output by the conditional generator and the original node embedding are respectively mapped to vectors h g and h r corresponding to the conditional label of the original node.
[0167] The convolution is used for weighted summation, and the discriminator feedback value reflecting the true or false degree of the synthetic sample g output by the conditional generator and the real node is output.
[0168] Specifically, in the conditional discriminator based on the boundary node, the input boundary node v obtains the fake sample g v and the embedding vector o v of node v, which are respectively mapped to vectors h g and h r corresponding to the conditional label y; h g and h r are subjected to one convolution weighted summation and output the discriminator feedback value reflecting the true or false degree of the node.
[0169] Further, in step 6, it includes:
[0170] Setting a model optimizer, calculating the classification loss of GCN; calculating the target loss function of the generator, updating the parameters of the conditional generator according to the parameter gradient calculated by the target loss function of the generator; calculating the target loss function of the conditional discriminator, updating the parameters of the conditional discriminator according to the parameter gradient calculated by the target loss function of the conditional discriminator; updating the parameters of the GCN convolution layer using the parameter gradient calculated by the classification loss of GCN.
[0171] Specifically, referring to Figure 4 In the model updater, the fake sample generated by the conditional generator is close to the real data distribution and matches the given class label, so the loss function L of the conditional generator is calculatedG The parameter gradient of the condition generator is updated by using the calculated loss function.
[0172] L G The calculation is as follows:
[0173]
[0174] In the formula, L G is the target loss function of the condition generator, V R is the decision boundary node set, z i is the noise vector of the i-th node, y i is the conditional label of the i-th node, D(G(z i |(y i , TI i )|y i ) is the true discrimination probability of the generated node by the discriminator;
[0175] The conditional discriminator needs to classify the false samples and real samples generated by the conditional generator. A well-trained classifier is needed to distinguish between true and false samples, and the loss function L D of the conditional discriminator is calculated by using the loss function to update the parameter gradient of the conditional discriminator. L D The calculation is as follows:
[0176]
[0177] Where, D(x i |y i ) is the discrimination probability of the discriminator that the real node is of class y i , and 1-D(G(z i |(y i , TI i )|y i ) is the “non-real” discrimination probability of the generated node by the discriminator.
[0178] The GCN is a basic model for graph node classification, and a well-trained classifier is needed to distinguish samples of different classes. The embodiment reversely enhances the expression ability of the GCN through the generation and confrontation training between the conditional generator and the conditional discriminator. Therefore, the classification loss L gcn of the GCN is calculated, L gcn and L D are combined together to form the GCN loss L, and the formal expression is as follows. The parameter gradient of the GCN convolution layer is updated by using L.
[0179]
[0180] L = aL gcn+ (1 - a)L D ;
[0181] The fixed GCN model parameters obtained after the training are used to input the data to be classified into the fixed GCN to obtain the classification result of the data to be classified.
[0182] Embodiment two,
[0183] An unbalanced graph node classification system based on a boundary node conditional GAN is run on an electronic device and applied to financial risk classification to solve the problem of uneven distribution of financial entity risk categories in risk classification.
[0184] A data acquisition module is configured to acquire a financial risk graph data set to be classified and pre-process the data. In this embodiment, financial entities, including companies, individuals (natural persons), regulatory agencies, and industries, are acquired. Financial relationships, including company-to-company relationships, company-to-industry relationships, and company-to-person relationships, are acquired. Calculation features, including market data and financial statements, are acquired. The financial entities, relationships, and features are constructed into a graph data form.
[0185] A boundary node evaluation unit is configured to evaluate the risk categories of misclassified financial entities and determine decision boundary nodes between different categories.
[0186] A condition generator unit is configured to generate synthetic nodes for corresponding categories based on boundary node categories and context structures.
[0187] A condition discriminator unit is configured to discriminate between original nodes and synthetic nodes and input two discriminator feedback values reflecting the true and false degrees of synthetic nodes g and real nodes v.
[0188] A model update unit is configured to update the conditional generative adversarial network model based on the feedback values until the loss function converges.
[0189] A model prediction unit is configured to perform classification prediction on financial entities to be classified based on the trained classification model.
[0190] The embodiment provides an electronic device that can perform the foregoing method, including a processor, a memory, and a program or instructions stored on the memory and executable on the processor, which, when executed by the processor, implement the steps of the unbalanced graph node classification method based on the boundary node conditional GAN.
[0191] In summary, the application provides an unbalanced graph node classification method and system based on boundary node conditional GAN, obtains original embedding vectors of original nodes through a two-layer GCN, calculates the final misclassification risk rate of the nodes after node balance calibration based on the original embedding vectors, trains the conditional label and conditional structure based generative adversarial network for the high misclassification risk rate nodes, updates the conditional discriminator and the conditional generator until the loss function converges, and reverses the expression capability of the GCN model based on the generative adversarial training. Through the above manner, the GCN classifier capable of effectively dealing with the class distribution imbalance is constructed.
[0192] The above is only a preferred specific embodiment of the application, but the protection scope of the application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical range disclosed in the application, which should be covered within the protection scope of the application. Therefore, the protection scope of the application should be subject to the protection scope of the claims.
Claims
1. An unbalanced graph node classification method based on boundary node conditional GAN, characterized in that, The method comprises the following steps: Obtaining financial entities, including companies, characters, regulatory agencies, and industries; Obtaining financial relationships, including company-to-company relationships, company-to-industry relationships, and company-to-person relationships; Obtaining calculation features, including market data and financial statements; Constructing the financial entities, financial relationships, and calculation features into a graph data form to construct a graph structure data set to be classified; Inputting the graph structure data set to be classified into a graph convolution network for node classification for processing and outputting a classification result; wherein the graph convolution network for node classification is trained by a training data set and obtained according to the convolution layer parameters obtained by training, and the training data set is a graph structure data set; Obtaining the graph convolution network for node classification comprises the following steps: Inputting the training data set into a neural network GCN structure containing two layers of graph convolution to obtain the embedding vector of the original node in the data set; Calculating the uncertainty score of each node according to the embedding vector of each node, and performing balance calibration to obtain the node misclassification risk rate, and obtaining a decision boundary node set based on the node misclassification risk rate; Inputting the boundary node into a conditional generator, encoding the input node according to the input conditional label and structure by using a multilayer perceptron, and outputting a synthetic node; Inputting the original node embedding and the synthetic node into a conditional discriminator, and performing conditional encoding on the input synthetic node and original node according to the input conditional label and structure by using a multilayer perceptron, and outputting two discriminator feedback values reflecting the true and false degrees of the synthetic node and the original node; Setting a model optimizer to calculate the classification loss of the GCN; calculating the target loss function of the generator, updating the parameters of the conditional generator according to the parameter gradient calculated in the reverse direction of the target loss function of the generator; calculating the target loss function of the conditional discriminator, updating the conditional discriminator according to the parameter gradient calculated in the reverse direction of the target loss function of the conditional discriminator, and updating the parameters of the GCN convolution layer according to the parameter gradient calculated in the reverse direction of the classification loss; According to the convolution layer parameters obtained by training, the trained graph convolution network for node classification is obtained, that is, the graph convolution network for node classification; Obtaining the decision boundary node set comprises the following steps: According to the embedding vector of each original node, calculating the node uncertainty score by Kullback-Leibler divergence, and performing balance calibration on the node uncertainty score to obtain the final node misclassification risk rate; Obtaining the top K% nodes according to the final node misclassification risk rate to obtain the decision boundary node set; Wherein, the node uncertainty score is calculated as follows: ; In the formula, For nodes v Embedded vector, ; C For the category label distribution set, C j For the first j The set of nodes of a class |C| Total number of categories; For nodes v Uncertain score, express KL The function to be calculated Represents a single-point distribution ŷ = j The value of the category, For nodes v Predicted labels; The final node misclassification risk rate is obtained as follows: ; wherein r v is the final misclassification risk rate, is the number of class nodes in the training set; R imb is the imbalance ratio of the training set.
2. The boundary node condition GAN-based unbalanced graph node classification method according to claim 1, characterized in that, The embedding vector of the original node is obtained by the following steps: Inputting the graph structure data set into the first graph convolution layer of the GCN to obtain the first graph convolution vector; Inputting the first graph convolution vector into an activation function to obtain an activation vector; Inputting the activation vector into the second graph convolution layer to obtain the embedding vector of the original node. 3.The boundary node condition based GANs unbalanced graph node classification method of claim 1, wherein, The synthetic node is outputted by the following steps: Mapping the conditional label to a conditional vector one by one-hot mapping, and integrating the context information of the node as a conditional structure to map to a conditional vector two; Noise z is obtained through Gaussian disturbance, and the noise z is connected with the conditional vector one and the conditional vector two in series and then learned through a standard multi-layer perceptron to be converted into a real-like fake sample, and the synthetic node is output; The conditional structure information of the node TI v The formal expression is obtained as ; wherein, N v represents a neighborhood node of the node v O u represents the original node embedding of the node u . 4. The boundary node condition GAN-based unbalanced graph node classification method according to claim 3, characterized in that, The discriminator feedback value is obtained, including: mapping the synthetic samples and the original node embeddings output by the condition generator to vectors corresponding to the condition labels of the original nodes h g and h r ; The weighted sum is performed using convolution, and outputs respectively reflect the synthetic samples of the conditional generator output g and the discriminator feedback value of the true node true false degree.
5. The boundary node condition GAN-based unbalanced graph node classification method according to claim 1, characterized in that, The target loss function of the generator is: ; In the formula, L G is a target loss function of the condition generator, is a decision boundary node set, is a noise vector of the first i node, is a condition label of the first i node, is a true discrimination probability of the discriminator on the generated node; The target loss function of the conditional discriminator is: ; In the formula, L D is the target loss function of the condition discriminator, is the discriminant probability of the discriminator that the real node is of the class is the non-real discriminant probability of the discriminator for the generated node; The loss of the GCN is: ; In the formula, L is the GCN loss, L gcn is the classification loss of the GCN, is the weight value.
6. An imbalanced graph node classification system based on boundary node conditional GAN, for implementing the steps of the imbalanced graph node classification method based on boundary node conditional GAN as claimed in any one of claims 1-5, characterized in that, Including: The data acquisition module is used to acquire financial risk graph source data, acquire financial entities including companies, persons, regulatory agencies and industries, acquire financial relationships including company-company relationships, company-industry relationships and company-person relationships, acquire calculation features including market data and financial statements, and construct the financial entities, the financial relationships and the calculation features into a graph data form to construct a graph structure data set to be classified; The model training module is used to input the graph structure data set to be classified into a graph convolution network for node classification for processing and output a classification result; wherein the graph convolution network for node classification is trained through a training data set and obtained according to convolution layer parameters obtained through training, and the training data set is a graph structure data set.
7. The boundary node condition-based GAN unbalanced graph node classification system of claim 6, wherein, The model training module includes: The boundary node evaluation unit is used to calculate the uncertainty score of each node according to the embedding vector of each node, perform balance calibration, obtain a node misclassification risk rate, and obtain a decision boundary node set based on the node misclassification risk rate; The conditional generator unit is used to input the boundary node into a conditional generator, encode the input node according to the input conditional label and structure by using a multi-layer perceptron, and output a synthetic node; The conditional discriminator unit is used to input the original node embedding and the synthetic node into a conditional discriminator, respectively encode the input synthetic node and the real node according to the input conditional label and structure by using a multi-layer perceptron, input the discriminator, and obtain a feedback value; The model updating unit is used to update the conditional generative adversarial network model based on the feedback value until the loss function converges; The model prediction unit is used to classify and predict the graph structure data set to be classified according to the trained classification model.
8. An electronic device, comprising: The device includes a processor, a memory, and a program or instruction stored on the memory and executable on the processor, and when the program or instruction is executed by the processor, the steps of the unbalanced graph node classification method based on the boundary node conditional GAN are implemented.
Citation Information
Patent Citations
Method for semi-supervised learning of structured data
CN109977094A
Classifier training using synthetic training data samples
US20240256967A1