Node classification method and system based on ES-GAGFormer model
By building the ES-GAGFormer model, combining the sampling methods of ENN and SMOTE and graph Transformers technology, the problem of insufficient representation of a few categories of samples in the unbalanced data node classification is solved, efficient and accurate node classification is achieved, and the robustness and classification accuracy of the model are improved.
Patent Information
- Application Number
- CN202411887458.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-15
AI Technical Summary
When the prior art processes imbalanced data in the graph node classification task, it is difficult to fully represent a few samples, resulting in poor model performance and classification accuracy needs to be improved.
Combining the comprehensive sampling methods of ENN and SMOTE and graph Transformers, we build an ES-GAGFormer model, and through feature extractors, resampling modules, edge generators and classification modules, we realize efficient and accurate classification of unbalanced data.
The node classification accuracy in unbalanced class distribution is improved, which is significantly better than the existing technology, while the calculation complexity remains unchanged, and it has better robustness.
Smart Images

Figure CN119830099A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of graph data mining and big data analysis, and more specifically to a node classification method and system based on an ES-GAGFormer model. Background Art
[0002] Node classification is a core task in graph data mining and is widely used in fields such as user attribute prediction in social networks, entity classification in knowledge graphs, and protein function prediction in biological networks. Its significance lies in that by accurately identifying the category attributes of nodes, it can reveal the underlying laws in the graph structure and provide key support for scientific research and practical applications. In recent years, graph neural networks (GNNs) have shown excellent performance in node classification tasks. However, existing GNNs lose some information about the high-order neighborhood of central nodes when processing node information. In addition, most existing GNNs are based on an incorrect assumption that samples of different categories are balanced. With the exponential growth of data in various industries, the imbalance of sample category data has become particularly prominent. When dealing with unbalanced data in graph node classification tasks, directly using raw data to train GNN classifiers or GAGFormer may not fully represent minority class samples, resulting in poor model performance and the need to improve classification accuracy. Therefore, unbalanced node classification has become an important research area.
[0003] In the GNN model, graph convolutional networks (GCNs) are the mainstream method for node classification, and many variants have been derived. GCNs are divided into spectral methods and spatial methods: in the spectral method, Bruna et al. use Fourier basis for graph convolution, and ChebNet introduces smoothing filters to achieve localization and simplify computational complexity. Kipf et al. further simplified the parameters of ChebNet. Spatial methods aggregate neighbor node information, such as the GraphSAGE model, which samples and aggregates features of neighbor nodes through graph sampling to ensure that the number of sampled neighbors of each node is limited. While considering the global information of the entire network, local node information is used for node embedding and representation learning. However, when the node categories are unbalanced, the information of minority class nodes is easily ignored or diluted. The graph attention network (GAT) aggregates features through the attention mechanism, but it may still ignore minority class nodes in unbalanced situations. In addition, these methods suffer from information loss when aggregating multi-order neighbor information, and it is difficult to correct the deviation of multi-category nodes during training, which is not suitable for directly dealing with unbalanced node classification problems.
[0004] In the field of imbalanced node classification, some experts have conducted in-depth research. Shi et al. proposed a graph convolutional neural network with two regularizations, which promotes category balance by training unlabeled nodes to make their data distribution similar to that of good training nodes. However, the complexity of this model increases significantly when the number of dataset samples increases sharply. Zhao et al. balanced the classification by generating oversampling methods for nodes and edges, but ignored the complex relationships between nodes, resulting in quality problems and increased complexity of edge generation. To this end, Wu et al. proposed GraphMixup, which creates mixed features in different semantic spaces and introduces context-based edge mixing, but this blurs the original graph features and introduces noise. Liang et al.'s ImGAGN model integrates minor nodes through feature interpolation, but its performance depends on the diversity of training data, and may reduce the quality of feature representation when training data is insufficient. Joonhyung et al. proposed GraphENS, which generates minor nodes by synthesizing complete nodes, but this method is susceptible to noise and requires preprocessing, resulting in information loss. The graph neural network framework combined with curriculum learning (GNNCL) proposed by Li et al. aims to overcome the limitations of traditional sampling methods in graph-structured data. The framework introduces an adaptive graph oversampling method by adding nodes and edges and generating new edges based on two basic properties. However, GNNCL has shortcomings in handling unbalanced node classification. Due to the uneven distribution of labels, GNNCL has difficulty in accurately distinguishing and classifying minority classes, affecting the accuracy and generalization ability of the model. In addition, the model relies on high-quality and representative graph structure data. If the input graph contains incomplete or noisy information, the performance will be significantly reduced.
[0005] Although the above research has made some progress in solving the problem of graph data imbalance, it still faces challenges such as inaccurate edge generation, high complexity, and insufficient expression of minority classes. Therefore, how to achieve efficient and accurate node classification of imbalanced data is an urgent problem that technicians in this field need to solve. Summary of the invention
[0006] In view of this, the present invention provides a node classification method and system based on the ES-GAGFormer model that at least solves some of the above-mentioned technical problems, wherein the ES-GAGFormer model is built by combining the comprehensive sampling method of ENN and SMOTE with graph Transformers. The model can efficiently and accurately complete the classification of unbalanced data nodes and has strong generalization performance.
[0007] To achieve the above object, the technical solution adopted by the present invention is:
[0008] In a first aspect, an embodiment of the present invention provides a node classification method based on an ES-GAGFormer model, the method comprising:
[0009] The ES-GAGFormer model is constructed by combining the comprehensive sampling method of ENN and SMOTE with the global attention map Transformer;
[0010] Training the ES-GAGFormer model;
[0011] The trained ES-GAGFormer model is used to complete the classification of the target imbalanced data nodes.
[0012] Furthermore, the constructed ES-GAGFormer model includes: a feature extractor, a resampling module, an edge generator and a classification module.
[0013] Furthermore, the ES-GAGFormer model uses GraphSAGE in GNN as the core module of the feature extractor, which promotes the generation of synthetic nodes by retaining node attributes and graph topology; learns node representations through message passing and fusion processes to measure the similarity between nodes; the expression of the message passing and fusion process in the feature extractor is:
[0014]
[0015] Where F represents the input node attribute matrix, F v: Represents the attribute of node v, A :v is the vth column of the adjacency matrix, is the embedding of node v, W 1 is the weight parameter and σ(·) is the activation function.
[0016] Furthermore, the resampling module is used to make the original unbalanced data set more balanced, including an ENN undersampling process and a SMOTE oversampling process, wherein:
[0017] The ENN undersampling process is as follows: for the majority class sample, the Euclidean distance to the nearest neighbor sample is calculated and iteratively traversed; for each sample, the class of its adjacent samples is checked, and if more than half of the adjacent samples belong to the majority class, the sample is retained, otherwise the sample node will be deleted; the specific undersampling steps include:
[0018] First, suppose is a labeled majority class node, and the Euclidean distance measure is used in the graph structure to find All nearest neighbor nodes N(v) belonging to the same class, the number of nodes is s, and the calculation formula of N(v) is:
[0019]
[0020] In the formula, express Neighbor nodes of
[0021] Then, find The number of all neighbor nodes of a node is t; according to the inequality Determine whether to keep or remove this node: If If the number of neighbors s of the same class as a node is greater than or equal to half of the total number of all neighbor nodes t, then this node is retained; otherwise, this node and its corresponding edge are deleted;
[0022] The SMOTE oversampling process is: interpolating the minority class samples with their nearest neighbor samples of the same class in the graph structure to generate new nodes; the specific oversampling steps include:
[0023] First, we find The number of all neighbor nodes h and The number of nearest neighbor nodes g belonging to the same category is, according to the inequality When with When the number of neighbor nodes g belonging to the same category is less than half of the total number of all neighbor nodes h, the minority class node is generated; otherwise, no operation is performed;
[0024] Then, select Nearest neighbor node Generate a new node and get the node embedding representation of the new node. The expression for generating the new node is:
[0025]
[0026] In the formula, represents the embedding representation of the newly generated node, express feature embedding, λ is a random number between 0 and 1, which determines the position of the newly generated node.
[0027] Furthermore, the edge generator introduces an attention mechanism to dynamically adjust the importance of each node. By learning the relationship and weight relationship between nodes, it generates links between new nodes and links between new nodes and original nodes in the feature space. The sigmoid function is used to calculate the similarity between the feature vectors of the nodes, and edges are generated to construct a new balanced graph structure.
[0028] Furthermore, the roulette wheel sampling method is used to determine whether to generate an edge based on the probability of the relationship between nodes.
[0029] Furthermore, the classification module is a node classifier based on GAGFormer, in which GraphSAGE is used in combination with a node classification linear layer; and a cross entropy loss function is used for optimization.
[0030] In a second aspect, an embodiment of the present invention further provides a node classification system based on an ES-GAGFormer model, which applies the above-mentioned node classification method based on an ES-GAGFormer model to complete the classification of target unbalanced data nodes, and the system includes:
[0031] Model building module, which is used to build the ES-GAGFormer model by combining the comprehensive sampling method of ENN and SMOTE with the global attention map Transformer;
[0032] A model training module, used for training the ES-GAGFormer model;
[0033] The model application module is used to use the trained ES-GAGFormer model to complete the classification of target imbalanced data nodes.
[0034] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the above-mentioned node classification method based on the ES-GAGFormer model.
[0035] In a fourth aspect, an embodiment of the present invention further provides a storage medium on which one or more programs readable by a computing device are stored, and the one or more programs include instructions, which, when executed by the computing device, enable the computing device to execute the above-mentioned node classification method based on the ES-GAGFormer model.
[0036] Compared with the prior art, the present invention has at least the following beneficial effects:
[0037] The present invention provides a node classification method and system based on the ES-GAGFormer model, wherein the ES-GAGFormer model is built by combining the comprehensive sampling method of ENN and SMOTE with graph Transformers, and the model can efficiently and accurately complete the node classification of unbalanced data. The present invention is significantly better than the prior art in processing class imbalance tasks, while the computational complexity remains unchanged; and it has better robustness and can effectively process node classification tasks under unbalanced data in graph data mining.
[0038] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description and the accompanying drawings.
[0039] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0041] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention.
[0042] Figure 1 A schematic diagram of the process flow of a node classification method based on the ES-GAGFormer model provided in an embodiment of the present invention.
[0043] Figure 2 A schematic diagram of adjacent nodes of a central node provided in an embodiment of the present invention.
[0044] Figure 3 A schematic diagram of the GAGFormer model structure provided in an embodiment of the present invention.
[0045] Figure 4 A schematic diagram of the ES-GAGFormer model structure provided in an embodiment of the present invention.
[0046] Figure 5 A schematic diagram for comparing ACC classification indicators of various models provided in an embodiment of the present invention.
[0047] Figure 6 A schematic diagram comparing the training time of each model provided in an embodiment of the present invention.
[0048] Figure 7 A schematic diagram of the impact of the number of under-sampling neighbors on model performance evaluated by the AUC-ROC indicator provided in an embodiment of the present invention.
[0049] Figure 8 A schematic diagram of the impact of the number of under-sampling neighbors on model performance evaluated by the F1-Macro indicator provided in an embodiment of the present invention.
[0050] Fig. 9 A schematic diagram of the change of the AUC-ROC of the Cora dataset imbalance rate provided by an embodiment of the present invention.
[0051] Fig.10 A schematic diagram of the changes in the imbalance rate F1-Macro of the Cora data set provided by an embodiment of the present invention.
[0052] Fig.11 A schematic diagram of the change of AUC-ROC for adjusting the imbalance rate of the Citeseer dataset provided in an embodiment of the present invention.
[0053] Fig.12 A schematic diagram of the changes in the imbalance rate F1-Macro of the Citeseer dataset provided in an embodiment of the present invention.
[0054] Fig.13 A schematic diagram of the change of AUC-ROC for adjusting the imbalance rate of PubMed dataset provided by an embodiment of the present invention.
[0055] Fig.14 A schematic diagram of the changes in the PubMed dataset imbalance rate F1-Macro provided in an embodiment of the present invention.
[0056] Fig.15 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments.
[0058] In the description of the present invention, it should be noted that: in some processes described in the specification and drawings of this application, multiple operations appearing in a specific order are included, but it should be clearly understood that these operations may not be performed in the order in which they appear in this document or may be performed in parallel. In addition, various serial numbers are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0059] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0060] like Figure 1 As shown, the present invention provides a node classification method based on the ES-GAGFormer model, which mainly includes:
[0061] An ES-GAGFormer model is constructed by combining the comprehensive sampling method of ENN and SMOTE with the global attention graph Transformer; the ES-GAGFormer model is trained; and the trained ES-GAGFormer model is used to complete the classification of target imbalanced data nodes.
[0062] The following describes in detail the relevant theories and specific implementation methods of the method of the present invention:
[0063] At present, GCN (Graph Convolutional Network) performs well in node classification tasks, mainly because it can make full use of graph structure information and capture the local relationship between nodes by combining the features of nodes with the structural information of their neighbors. At the same time, GCN smoothes node features through feature aggregation, making the features of similar nodes more consistent, thereby improving classification accuracy. In addition, GCN adopts an end-to-end learning method, which can optimize feature representation to adapt to diverse graph structures and node distributions, and the parameter sharing mechanism makes the model more efficient and has low computational overhead, which is suitable for a variety of scenarios such as social networks, knowledge graphs, and biological networks. However, GCN has the following three problems: GCN faces class imbalance in node classification tasks, and it is easy to give priority to majority class nodes, resulting in insufficient capture of minority class features; there are inaccurate edge generation and insufficient representation of minority classes when sampling graph data; information loss is prone to occur when aggregating neighbor information. In view of the above problems, the present invention proposes a global attention graph Transformer model (ES-GAGFormer) combining ENN and SMOTE. The global attention mechanism is introduced into the graph Transformer model, and the neighbor node information is extracted in parallel with the GCN layer to solve the problem of feature loss when aggregating neighbor information in GCN, and improve the feature capture ability of minority class nodes; the sampling is combined with the ENN and SMOTE methods to balance the data set and enhance the representativeness of minority class nodes in the sampling process, avoiding the problem of inaccurate edge generation; through the designed global attention mechanism and comprehensive sampling method, the model pays more attention to the minority class node features when dealing with unbalanced class distribution, thereby effectively improving the node classification accuracy. Experiments on three node classification data sets show that the model is significantly better than the existing graph neural network and GAGFormer in dealing with class imbalance tasks, while the computational complexity remains unchanged.
[0064] 1. Related theories:
[0065] 1.1GAGFormer:
[0066] 1.1.1GCN model:
[0067] At present, for the GCN model and its related variants, the update information of the graph sample nodes is performed by aggregating the information of the local neighbor nodes. The nodes directly connected to a central node are defined as the first-order domain nodes of this node, and the nodes indirectly connected to the central node are called second-order domain nodes, and so on. Figure 2 When the sample center node aggregates information of the second-order domain and above, it needs to obtain information far away from the center node through indirect aggregation. This means that GCN can only effectively aggregate information of a fixed number of nodes around a certain node, and information of the second-order and above will be lost during the aggregation process.
[0068] In order to solve the shortcomings of the GCN model itself, the present invention uses global attention graph Transformers (GAGFormer) to alleviate the information loss problem caused by the node aggregation process. A global attention layer is designed in GAGFormer to generate new sample features, and a different node feature is generated in parallel with the GCN layer. The two node features are weighted and combined to obtain new sample features. This process can directly aggregate the information of sample nodes in non-1st-order domains, rather than indirectly, and then fuse the aggregated features into a more informative feature representation.
[0069] 1.1.2GAGFormer model:
[0070] GAGFormer uses the method of generating two parts of new information from the same node and performing weighted summation. It gradually builds a global attention matrix and an adjacency matrix to learn the network topology of the model. This process is guided by node classification accuracy, while taking into account the information content of the data set and the computational complexity of the model. Figure 3 As shown. The core idea of GAGFormer is to design a global attention layer (GAL) to address the information loss caused by the fixed receptive field of GCN. Each node can directly exchange information with all other nodes in the association graph to achieve global information interaction to update the features of the first part of the sample nodes. GAL contains three vectors (Query, Key, Value), which are obtained by multiplying the input node feature vector by the weight matrix. The weight matrix is obtained through training and learning, which directly aggregates the information of neighboring nodes without losing information that is not indirectly connected to the node. The node feature vector obtained at a certain layer is denoted as Z (L) , and record the node features of the next layer as Z (L+1) . Through Q, K, V, the node feature Z (L) After updating the attention matrix P, the P matrix is used to propagate the feature information of the node, realizing feature information propagation similar to GCN. The P matrix can be obtained by formula (1):
[0071]
[0072] The node feature vector Z (L) Through linear transformation, we get the Query (Q) and Key (K) vectors respectively, and calculate their dot product to get the attention score. k is the dimension of the K vector. By scaling these scores, the range of attention scores can be reduced, making the gradient more stable during back propagation. Then it is converted to a weight in [0,1] through softmax to indicate the importance of each K vector. Finally, the Value (V) vector is weighted and summed according to these weights to obtain the final attention output matrix P.
[0073] The updated node information is obtained by weighted summing of the features of each node and its neighboring nodes, and combining the weight matrix for linear transformation and activation function. The fusion and enhancement of features are achieved. Therefore, the above complete process can be defined by formula (2):
[0074]
[0075] in, represents the first part of the features of the L+1th layer nodes obtained by weighted combination of the feature attention matrix and the features of the Lth layer nodes, σ is a nonlinear activation function, P is the attention matrix, and Z (L) is the node feature of the Lth layer, W L is the weight matrix of the Lth layer.
[0076] The second part of the sample node features is obtained by the GCN layer. The GCN layer updates the node representation by aggregating node neighbor information, and each node updates its own representation by aggregating neighbor node features. In the GCN layer, the node aggregates other neighbor node features to obtain the second part of the node features The polymerization process can be expressed by formula (3):
[0077]
[0078] In the formula, represents the second part of the features of the L+1th layer nodes, which is obtained by aggregating the adjacency matrix and the Lth layer node features and weighted combination. σ is a nonlinear activation function, is the adjacency matrix A plus the identity matrix E. Z (L) is the node feature vector of the Lth layer, W L is the weight matrix of the Lth layer.
[0079] Obtained through the GAL layer and GCN layer and The two parts of node features are transformed through the nonlinear activation function fL The final node features of the L+1 layer are obtained by weighted summation, as shown in formula (4):
[0080]
[0081] In the formula, Z (L+1) Represents the final node features.
[0082] 1.2 Resampling algorithm:
[0083] At present, most GNN models assume that node samples are balanced between categories. Although GAGFormer solves the problem of partial information loss during node information acquisition in the previous section 1.1, it is also based on the assumption that sample node categories are balanced. Under this assumption that sample data is balanced, training the GAGFormer classifier with original data may result in an inability to fully mine the information features of the data, because GAGFormer cannot fully represent minority category samples, thereby affecting model performance. Therefore, the present invention adopts a resampling algorithm to solve the problem of unbalanced classification.
[0084] The resampling technique in the present invention includes using oversampling and undersampling to balance the sample distribution of imbalanced data. ENN (Edited Nearest Neighbor) is an undersampling method that aims to process imbalanced data sets by removing samples that may be misclassified. The main idea is to use the nearest neighbor rule to clean the data and delete samples that are inconsistent with the category of their nearest neighbor samples to reduce noise and boundary samples. However, ENN is very sensitive to the selection of the number of nearest neighbor samples. Improper selection may cause too many samples to be deleted or noise samples to be retained. Therefore, the optimal number of neighbors usually needs to be adjusted through cross-validation, which increases the complexity of model design. SMOTE (Synthetic Minority Oversampling Technique) is an oversampling method that generates new samples by randomly selecting samples and performing linear interpolation between the selected samples and their nearest neighbors. Although SMOTE can partially alleviate the imbalance in data distribution, the lack of specific selection criteria before linear interpolation of minority class samples may cause classifier overfitting. To address this problem, the present invention adopts a hybrid sampling strategy, which combines undersampling and oversampling to make up for the shortcomings of using oversampling or undersampling alone. By synthesizing minority class samples and removing noise samples, the classification imbalance problem can be solved, and the model performance and generalization ability can be improved.
[0085] 2. Build the ES-GAGFormer model:
[0086] In the embodiment of the present invention, the model architecture of ES-GAGFormer is constructed. The local modules, submodules and overall modules of the model are designed respectively. The main idea of ES-GAGFormer is to use sampling and edge generation techniques in the expression embedding space obtained by the global attention graph Transformers (GAGFormer) to improve the classification efficiency of unbalanced data of nodes. ES-GAGFormer consists of four parts: a feature extractor based on GraphSAGE, a resampling module, an edge generator and a node classification module based on GAGFormer. The model architecture of ES-GAGFormer is as follows Figure 4 shown.
[0087] In the present invention, ES-GAGFormer can make full use of the feature extraction capability of GAGFormer, and the feature extractor used for sample balance can improve the node classification efficiency of unbalanced data sets. The innovation of ES-GAGFormer lies in that it comprehensively uses undersampling, oversampling and edge generation techniques to solve the node classification problem in unbalanced graph data.
[0088] 2.1 Feature Extraction:
[0089] In an embodiment of the present invention, the feature extractor promotes the generation of synthetic nodes by preserving node attributes and graph topology. Graph convolutional networks (GCNs) can generally be used to accomplish this task. However, GCN cannot handle various types of local topologies well, resulting in limited efficiency when processing new graph structures. In order to overcome these problems, GraphSAGE is introduced to improve GCN, which can effectively capture the structural and attribute information of nodes and their neighbors, and learn from various types of local topologies, with strong generalization performance. ES-GAGFormer uses GraphSAGE as the core module of the feature extractor to realize the learning of node representation. In this module, the message passing and fusion process are shown in formula (5). The feature extractor plays a key role in learning node representation and promotes the generation of synthetic nodes by preserving node attributes and graph topology.
[0090]
[0091] Where F represents the input node attribute matrix, F v: Represents the attributes of node v. A :v is the vth column of the adjacency matrix, is the embedding of node v, W 1 is the weight parameter, and σ(·) is an activation function such as Relu().
[0092] The ES-GAGFormer model constructed by the present invention uses GraphSAGE in GNN as a feature extractor and learns node representations through message passing and fusion processes to measure the similarity between nodes.
[0093] 2.2 Resampling:
[0094] In an embodiment of the present invention, the resampling module makes the original unbalanced data set more balanced. ES-GAGFormer combines undersampling and oversampling methods to solve the problem of unbalanced data sets. ES-GAGFormer uses the ENN undersampling method to reduce the majority class classification nodes according to their density in the feature space. The low-density majority class sample nodes are removed to reduce the noise and duplicate samples in the majority class samples of the unbalanced data set, thereby improving the accuracy of the classifier. Then, ES-GAGFormer uses SMOTE to generate minority class sample nodes. The SMOTE technology synthesizes new minority class nodes, increases their number of samples, and interpolates them with adjacent minority class nodes into the feature space, thereby enhancing the classifier's ability to learn from the minority class. The resampling module includes an ENN undersampling process and a smote oversampling process.
[0095] 2.2.1ENN undersampling process:
[0096] In the feature extraction part, after obtaining the representation of each sample node in the embedding space constructed by the feature extractor, the majority class nodes are undersampled. The core idea of ENN undersampling is as follows: for the majority class samples, we calculate the Euclidean distance to the nearest neighbor samples and iterate through the majority class samples. For each sample, check the class of its neighboring samples. If more than half of the neighboring samples belong to the majority class, keep this sample, otherwise the sample node will be deleted. The specific undersampling steps are as follows:
[0097] First, suppose is a labeled majority class node. Use the Euclidean distance measure in the graph structure to find All nearest neighbor nodes N(v) belonging to the same class, the number of nodes is s, and the calculation formula of N(v) is shown in formula (6)
[0098]
[0099] in, express neighbor nodes.
[0100] Then, find The number of all neighboring nodes of a node is t. According to inequality (7), the stay or leave of this node is determined: If the number of neighbors s of the same class as a node is greater than or equal to half of the total number of all neighbor nodes t, then the node is retained; otherwise, the node and its corresponding edges are deleted.
[0101]
[0102] According to the above ENN undersampling process, the noise and repeated samples in the majority class samples of the imbalanced dataset are reduced.
[0103] 2.2.2SMOTE oversampling process:
[0104] After deleting some majority class sample nodes through the ENN algorithm, the minority class is oversampled to generate a representation of the new sample. SMOTE interpolates the minority class samples with their nearest neighbor samples in the graph structure to generate new nodes. Similar to ENN node generation, it first finds the The number of all neighbor nodes h and The number of nearest neighbor nodes g belonging to the same category, according to inequality (8), is equal to When the number of neighbor nodes g belonging to the same class is less than half of the total number of all neighbor nodes h, the minority class node is generated; otherwise, no operation is performed.
[0105]
[0106] Furthermore, select Nearest neighbor node Generate a new node according to formula (9) and get the node embedding representation of the new node:
[0107]
[0108] In formula (9), represents the embedding representation of the newly generated node, Representation Node The feature embedding of the node, λ is a random number between 0 and 1, which determines the position of the newly generated node. When λ is 0, Just position; when λ is 1, Just When λ is between 0 and 1, lie in and Somewhere in between.
[0109] because and Belong to the same category of samples, and the distribution is close, so the generated new section Also belongs to the same category.
[0110] In the present invention, an enhanced version of the data set is obtained by using the ENN method to reduce the majority class samples and using the SMOTE method to increase the minority class samples. This method can make the data set more balanced and improve the performance of the classifier.
[0111] 2.3 Edge generation:
[0112] Since there is no edge connecting the new nodes generated by the new sampling module to the original nodes, an edge generator is designed in the embodiment of the present invention. ES-GAGFormer combines the attention mechanism and GraphSAGE to predict the links between new nodes. The edge generator generates links between new nodes and links between new nodes and original nodes in the feature space by learning the relationship and weight relationship between nodes, and constructs a new balanced graph structure. This enables GAGFormer to effectively capture the structure and information between nodes and improve the classification performance of the model.
[0113] Because the importance of the original node in the graph structure will greatly affect the distribution of weights to each node, causing the newly generated nodes to be unable to participate in the model training process, the edge generator introduces an attention mechanism to dynamically adjust the importance of each node, which can ensure that more weight is given to minority nodes during model training and that the interaction between nodes is considered when calculating feature vectors. The sigmoid function is used to calculate the similarity between the feature vectors of two nodes, generate edges to establish a complete graph structure, and the specific steps for generating edges are as follows:
[0114] First, we obtain the feature embedding vectors of each node after the new and old nodes are weighted by the attention mechanism. In the resampling part, we obtain the feature vectors of the new and old nodes, and input these feature vectors into formula (10) to obtain the attention embedding representation of the node.
[0115]
[0116] Where W is the weight parameter, n(v) is the set of neighboring nodes of node v, and h v is the feature vector of node v, h u is the feature vector of node u, H′ v is the feature vector of node v calculated by the attention mechanism, a v,u Indicates the degree of attention of node u to node v, a v,u The calculation formula is as follows:
[0117]
[0118] Among them, LeakyReLU is a transformation of ReLU, which mainly introduces a slope for negative input values. Because in ReLU, if the input value is less than 0, the output value is always 0, in order to prevent the gradient of the model from always becoming 0 during the training process and no longer being able to participate in learning; a represents a trainable attention vector, and || represents a vector concatenation operation. It can be seen in the denominator of formula (11) that all neighbor nodes of node v are traversed, including its own node, because the traversal of its own node may play an implicit regularization role to prevent the model from over-relying on the features of neighbor nodes, and it provides the model with node autocorrelation information, which can help the model learn the self-features of the node during training, thereby enhancing the robustness of the model when processing data. Through these steps, the attention mechanism realizes the dynamic weighting of nodes to neighbor nodes in the graph neural network, so that the model can better capture the complex relationship between nodes.
[0119]
[0120] Then, the relationship information edge E between the predicted node representations of nodes v and u is calculated by formula (12): v,u , where S represents the parameter interaction matrix, capturing the interaction between node v and node u, It can be understood as the transformed similarity score of two nodes, which reflects the similarity between the nodes. The σ function performs a nonlinear transformation on the similarity score, making the output value more suitable for the needs of downstream tasks. Softmax converts the correlation scores between all possible node pairs into a probability distribution. For each node v, the softmax function is used to calculate the probability E between each possible connected node u. v,u , the sum of these probabilities is 1.
[0121] Finally, E. v,u The roulette wheel sampling method is used to decide whether to generate an edge between node v and node u. Roulette wheel sampling is a technique for random selection based on probability distribution, which determines whether to generate an edge based on the probability of the relationship between nodes. The specific steps of roulette wheel sampling to generate edges are:
[0122] ①. Calculate the probability distribution of node pairs:
[0123] Assume that the node v and the candidate node set {u1, u2, u3, ...u n}, and obtain the relationship probability of each node pair by calculating and softmax
[0124] ②Generate random numbers:
[0125] Generate a random number r∈[0,1] from a uniform distribution.
[0126] ③. Calculate the cumulative probability based on the probability distribution:
[0127] Calculate the cumulative probability of each node pair. For u1, the cumulative probability For u2, the cumulative probability for Random numbers are mapped to specific node pairs based on these cumulative probabilities.
[0128] ④. Determine the selected node:
[0129] Compare the random number and the cumulative probability. If r≤C1, select u1; if C1<r≤C2, select u2; if C2<r≤C3, select u3...if C n-1 <r≤C n , then select u n .
[0130] Roulette sampling selects nodes by generating a random number and comparing it with the cumulative probability. This method is based on the randomness of the probability distribution, so that the selection probability of each node pair is proportional to its relationship score, so that the generation of edges can be dynamically determined according to the similarity between nodes.
[0131] 2.4 Classification module:
[0132] In the embodiment of the present invention, GraphSAGE is still used for node classification prediction, because GraphSAGE only relies on local neighbor information for feature aggregation, and can better handle dynamically changing graph structures, so that it can perform well on different graph data sets, and can capture different neighbor relationships and graph structure characteristics, thereby improving the effect of node classification. In sections 2.2 and 2.3, the newly generated edges and nodes have been obtained, that is, the new augmented graph structure has been obtained. Assume that the augmented graph Represents the enhanced node adjacency matrix obtained by connecting the original node adjacency matrix A and the adjacency matrix of the newly generated node, represents the enhanced node set obtained by connecting the original node embedding and the newly generated node embedding, V pp Represents the newly generated node and node set V p The enhanced label set after merging the original nodes of It is already a dataset with balanced sizes of different data categories, so an unbiased GAGFormer classifier can be trained. In the classification module, GraphSAGE is used in conjunction with a node classification linear layer.
[0133]
[0134]
[0135] In the formula, is the embedding of node v, represents the set of enhanced nodes obtained by connecting the original node embedding and the newly generated node embedding, represents the vth column of the newly generated adjacency matrix, Represents the feature vector of the newly generated v node, V 2 is the node representation matrix of the second layer of GraphSAGE, W is the weight parameter, p v Represents the probability distribution of node v on the class label. The cross entropy loss function is used to optimize the model. Formula (15) is the back propagation optimization formula.
[0136]
[0137] Set the predicted class of node v to Y′ p The class with the highest probability is shown in formula (16):
[0138] Y′ p = argmax(P v {c)) (16)
[0139] Through the above steps, the final classification result Y′ can be obtained p .
[0140] 2.5 Training Algorithm:
[0141] In the embodiment of the present invention, the feature extractor, the resampling module, the edge generator and the node classification module constitute the ES-GAGFormer model. The objective function L loss As shown in formula (17):
[0142]
[0143] Among them, α, β, and γ are the parameters of the feature extractor, edge generator, and node classifier, respectively. Since the performance of the model depends on the quality of the embedding space and the quality of the generated edges, L loss(2) Represents the loss function of the edge generation task, which measures the quality of the generated edge. The edge generator is based on edge prediction and uses cross entropy loss to calculate the difference loss between the real edge and the generated edge. The specific formula is:
[0144]
[0145] Among them, A ij represents the true adjacency matrix, is the edge probability matrix generated. Using L loss(2) Pre-training the feature extractor and edge generator makes the training process more stable.
[0146] The ES-GAGFormer model constructed in the embodiment of the present invention has the following advantages, which can be summarized as follows: (1) The ENN algorithm effectively reduces the error rate of the classifier by removing low-quality sample data and improves the performance stability of the model. (2) The SMOTE algorithm expands the original graph topology by generating new nodes, making the data set more balanced and improving the classification performance of the model. (3) The attention mechanism can consider the relationship between nodes, focus on the key information with higher weight in the input data, ignore other irrelevant information, and make the node synthesis aggregation on the graph more accurate.
[0147] 3. Experimental verification:
[0148] 3.1 Experimental setup:
[0149] Datasets: Three public datasets, Cora, Citeseer, and PubMed, were used. The Cora dataset consists of 2708 scientific publications, and its citation network consists of 5429 links. Each publication in the dataset is represented by a binary word vector with a value of 0 / 1, indicating the absence / presence of the corresponding word in the dictionary. The dictionary consists of 1433 unique words, which means that each publication has 1433 features, each represented by a 0 / 1 value. The Citeseer
[26] dataset includes 3312 scientific publications. The citation network consists of 4732 links. Similar to the Cora dataset, each publication in Citeseer is described by a word vector value of 0 / 1, indicating the absence or presence of a word in the dictionary. The dictionary of Citeseer contains 3703 unique words, so each publication has 3703 features, each represented by a 0 / 1 value. The PubMed
[27] dataset includes 19,717 scientific publications on diabetes. The citation network consists of 44,338 links. Each publication in the dataset is described by a TF / IDF weighted word vector containing 500 unique words in the dictionary. Therefore, each publication in the PubMed dataset has 500 features, each represented by a TF / IDF weighted value.
[0150] In these datasets, the class distribution is relatively balanced, so a simulated imbalanced setting is used: three classes are randomly selected as minority classes and downsampled. All majority classes have a training set containing 20 nodes. For each minority class, the number is 20× the imbalance ratio.
[0151] Experimental equipment: ES-GAGFormer was written in Pyhon3.7, and experiments were conducted in the Windows 11 operating system, using the Pytorch 1.3 machine learning framework, as well as the Intel i7-13700K CPU and RTX 3060Ti GPU.
[0152] Performance indicators: Average accuracy, AUC-ROC, and F1-Macro are used to measure the ability of the ES-GAGFormer model to solve imbalanced classification. Average accuracy is usually used for multi-classification problems where each category has the same importance and a similar number of categories, and does not take into account the problem of class imbalance. F1-Macro is the arithmetic mean of the F1 scores of each category. It attaches equal importance to each category, so it can effectively reflect the classification performance on different categories. AUC-ROC reflects the overall performance of the model at different thresholds, so neither F1-Macro nor AUC-ROC indicators will be affected by class imbalance.
[0153] Comparison models: To verify the effectiveness of this method, the ES-GAGFormer of the present invention is compared with the following models: MLP, GCN, GraphSAGE, GAT, DR-GCN, GraphSMOTE, NodeFormer, SGFormer, GAGFormer. The performance indicators of these models are compared with ES-GAGFormer to prove the accuracy and efficiency of ES-GAGFormer in graph node classification.
[0154] Parameter settings: For the training parameters of all models, the learning rate is 0.001 and the weight decay is set to 5×10 -4 , Λ is set to 1×10 -6 The imbalance ratio is set to 0.5 and the number of undersampled neighbors K is set to 3. For the three datasets, the first 4, 3, and 2 classes are selected as majority classes, the rest as minority classes, sorted by the number of nodes, and the runtime metric is added to analyze the training speed of the model.
[0155] 3.2 Experimental results:
[0156] 3.2.1 Comparative experiment:
[0157] Table 1 Comparison of unbalanced node classification methods
[0158]
[0159]
[0160] In this experiment, the models are divided into three types: balanced networks, unbalanced networks, and neutral networks. To verify the ability of each model to handle unbalanced sample classification. As can be seen from Table 1, when the data set is unbalanced, whether it is AUC-ROC or F1-Macro indicators, ES-GAGFormer shows the most significant performance improvement when dealing with unbalanced classification problems. In GAGFormer, the performance of the model is improved by adding the Global Attention layer in the graph Transformer. Although compared with other models, the performance is greatly improved when dealing with unbalanced node classification, it is limited compared to the GraphSMOTE model. ES-GAGFormer greatly improves the classification accuracy of unbalanced data by adding ENN undersampling and SMOTE oversampling technology.
[0161] The ACC index will be affected by the imbalance of the data set, so the performance of each model is measured by the fluctuating ACC index. Figure 5 and Figure 6 It can be seen that in these three data sets, the ACC of ES-GAGFormer is better than other models, which shows that ES-GAGFormer can also complete the classification task well under imbalanced data, with high performance and accuracy. Even under unstable measurement indicators, the model has strong classification ability. It is worth noting that the ACC indicator of GraphSMOTE is also very good, only about 1% lower than that of ES-GAGFormer in the three data sets, but due to Figure 6 It can be seen that the model training time of GraphSMOTE is the longest. This is because GraphSMOTE needs to oversample during the training process, which greatly delays the training time of the model. This shows that in most cases, even if GraphSMOTE has high classification accuracy, it may not be suitable for the classification of a large amount of imbalanced data. ES-GAGFormer shortens the model training time through undersampling and oversampling methods, making up for the shortcomings of the GraphSMOTE model and making it more suitable for node classification of imbalanced data.
[0162] 3.2.2 Ablation experiment:
[0163] In this experiment, the advantages of GAGFormer over GCN were studied, and SMOTE oversampling technology and ENN undersampling technology were added to GAGFormer to study the advantages of ES-GAGFormer. The imbalance ratio of the experimental parameters was set to 0.5, the loss weight was set to 0.1, and the number of oversampling neighbors K was set to 4. Each experiment was repeated three times and the average results were taken, as shown in Table 2. For these three graph datasets, GAGFormer improved the AUC-ROC and F1-Macro performance compared with GCN after adding the graph transformer, but the performance of GAGFormer added SMOTE oversampling in Cora and Citeseer decreased. This may be because SMOTE increases the number of samples of the minority class by generating synthetic samples, but these synthetic samples introduce noise data to disrupt GCN's learning of graph structure and node features, resulting in a decrease in model performance. When ENN undersampling was added in the sampling stage, the AUC-ROC and F1 scores of the Cora, Citeseer and PubMed datasets were improved compared with the original model. This shows that the ENN algorithm effectively reduces the error rate of the classifier and improves its performance stability by removing low-quality and noisy samples. By combining ENN undersampling and SMOTE oversampling technology and adding an attention mechanism, ES-GAGFormer can improve the performance and classification accuracy of the model, which proves that ES-GAGFormer is an effective method.
[0164] Table 2 Ablation experiment results
[0165]
[0166] 3.3 Analysis of the number of under-sampling neighbors:
[0167] In this experiment, the performance of different algorithms under different undersampling neighbors is analyzed to evaluate the impact of the number of undersampling neighbors on model performance. The experiment uses the Cora, Citeseer and Pubmed datasets, the experimental parameter imbalance ratio is set to 0.5, the loss weight is set to 0.1, the undersampling neighbors K are {2, 3, 4, 5}, and each experiment is repeated three times to take the average result.
[0168] like Figure 7 and Figure 8As shown in the figure, in the Cora dataset, when K = 4, the AUC-ROC and F1-Macro indicators are optimal, while when K = 5, the performance drops significantly. This shows that appropriately increasing the number of undersampled neighbors can improve the performance on this dataset. In the Citeseer dataset, AUC-ROC is optimal when K = 4, while F1-Macro is optimal when K = 5, which shows that different K values can also lead to deviations in different metrics. In the Pubmed dataset, when K = 3, the AUC-ROC and F1-Macro indicators are both optimal. In this dataset, undersampled neighbors with K equal to 3 are most beneficial to model performance.
[0169] In short, the choice of K value will be slightly different under different data sets. Choosing a K value that is too small may lead to the selection of inappropriate neighbors, thus affecting the performance of the model. Choosing a K value that is too large will also increase the number of nearest neighbors of each sample, resulting in insufficient retention of minority class samples and weakening the undersampling effect. Therefore, the selection of K value in the ENN algorithm should comprehensively consider the specific data set and application conditions.
[0170] 3.4 Analysis of unbalanced ratio:
[0171] In this experiment, the performance of different algorithms under different imbalance rates is analyzed to evaluate the robustness. The experiment uses the Cora, Citeseer and Pubmed datasets. The experimental conditions are: undersampled neighbors K = 4, loss weight is set to 0.1, and imbalance rates R are {0.1, 0.2, 0.4, 0.6} respectively. Each experiment is repeated three times and the average results are taken. Figures 9 to 14 It can be seen that in these three data sets, as the imbalance rate increases, the values of AUC-ROC and F1-Macro also increase. When R=0.6, ES-GAGFormer has the best data processing ability. It can be seen that ES-GAGFormer combined with undersampling and attention mechanism shows better robustness than the original SMOTE+GCN (GraphSMOTE) model under different imbalance rates, and can effectively handle imbalanced classification node tasks.
[0172] 4. Conclusion:
[0173] Through the description of the above embodiments, those skilled in the art can know that the present invention proposes a node classification method based on the ES-GAGFormer model; wherein ES-GAGFormer is constructed, which is based on the GAGFormer model and combines with ENN undersampling and SMOTE oversampling to achieve efficient unbalanced data node classification.
[0174] The present invention solves three main problems of existing GCN through ES-GAGFormer: 1) the problem of node aggregation neighbor information loss. 2) the problem of inaccurate classification of unbalanced data sets. 3) the problem of unbalanced weight distribution between generated new nodes and original nodes. Specifically, the present invention balances the original data set by adopting ENN undersampling and reduces the interference of noise samples on model training. SMOTE oversampling is used to generate minority class sample nodes to expand the graph structure. The attention mechanism is combined to adjust the importance of each node and generate edges to improve model performance, reduce model parameters and computational complexity. Through experiments on three public data sets, it can be seen that compared with traditional GCN and GCN variant algorithms, ES-GAGFormer has significant improvements in AUC-ROC, F1-Macro indicators and running speed. This shows that ES-GAGFormer is superior to existing models when processing unbalanced data.
[0175] Furthermore, the present invention also provides a node classification system based on the ES-GAGFormer model, which is applied to the node classification method based on the ES-GAGFormer model in the above embodiment to complete the classification of target unbalanced data nodes. The system includes:
[0176] Model building module, which is used to build the ES-GAGFormer model by combining the comprehensive sampling method of ENN and SMOTE with the global attention map Transformer;
[0177] A model training module, used for training the ES-GAGFormer model;
[0178] The model application module is used to use the trained ES-GAGFormer model to complete the classification of target imbalanced data nodes.
[0179] The implementation principle and technical effects of the system provided in the embodiment of the present invention are the same as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the system embodiment, reference can be made to the corresponding contents in the aforementioned method embodiment, which will not be repeated here.
[0180] Further, refer to Fig.15 As shown, an embodiment of the present invention further provides an electronic device, which may include a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, and the processor executes the computer program to implement the node classification method based on the ES-GAGFormer model in the above method embodiment.
[0181] The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 10 is the control core of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes various functions of the electronic device and processes data by running or executing programs or modules stored in the memory 11, and calling data stored in the memory 11.
[0182] In addition, an embodiment of the present invention also provides a storage medium on which one or more programs readable by a computing device are stored, and the one or more programs include instructions. When the instructions are executed by the computing device, the computing device executes a node classification method based on the ES-GAGFormer model in the above embodiment.
[0183] In the embodiment of the present invention, the storage medium may be, for example, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples of storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, and any suitable combination thereof.
[0184] It should be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, devices, or computer program products, etc. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more storage media containing computer usable program code.
[0185] It should be noticed that the word "comprising" does not exclude the presence of steps or components not listed in a claim.The invention can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer.
[0186] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0187] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A node classification method based on the ES-GAGFormer model, characterized in that: The method includes: The ES-GAGFormer model is constructed by combining the comprehensive sampling method of ENN and SMOTE with the global attention map Transformer; Training the ES-GAGFormer model; The trained ES-GAGFormer model is used to complete the classification of the target imbalanced data nodes.
2. According to claim 1, a node classification method based on the ES-GAGFormer model is characterized in that: The constructed ES-GAGFormer model includes: a feature extractor, a resampling module, an edge generator and a classification module.
3. The node classification method based on the ES-GAGFormer model according to claim 2, characterized in that: The ES-GAGFormer model uses GraphSAGE in GNN as the core module of the feature extractor, which promotes the generation of synthetic nodes by preserving node attributes and graph topology; and learns node representations through message passing and fusion processes to measure the similarity between nodes.
4. The node classification method based on the ES-GAGFormer model according to claim 2, characterized in that: The resampling module is used to make the original unbalanced data set more balanced, including an ENN undersampling process and a SMOTE oversampling process, wherein: The ENN undersampling process is as follows: for the majority class sample, the Euclidean distance to the nearest neighbor sample is calculated and iterated; for each sample, the class of its adjacent samples is checked, if more than half of the adjacent samples belong to the majority class, this sample is retained, otherwise the sample node will be deleted; The SMOTE oversampling process is to interpolate the minority class samples with their nearest neighbor samples of the same class in the graph structure to generate new nodes.
5. The node classification method based on the ES-GAGFormer model according to claim 2 is characterized in that: The edge generator introduces an attention mechanism to dynamically adjust the importance of each node. By learning the relationship and weight relationship between nodes, it generates links between new nodes and links between new nodes and original nodes in the feature space. The sigmoid function is used to calculate the similarity between the feature vectors of the nodes, and edges are generated to construct a new balanced graph structure.
6. The node classification method based on the ES-GAGFormer model according to claim 5, characterized in that: The roulette wheel sampling method is used to decide whether to generate an edge based on the probability of the relationship between nodes.
7. The node classification method based on the ES-GAGFormer model according to claim 2, characterized in that: The classification module is a node classifier based on GAGFormer. In the classification module, GraphSAGE is used in combination with a node classification linear layer; and a cross entropy loss function is used for optimization.
8. A node classification system based on the ES-GAGFormer model, characterized in that: A node classification method based on the ES-GAGFormer model as described in any one of claims 1 to 7 is applied to complete the classification of target unbalanced data nodes, and the system includes: Model building module, which is used to build the ES-GAGFormer model by combining the comprehensive sampling method of ENN and SMOTE with the global attention map Transformer; A model training module, used for training the ES-GAGFormer model; The model application module is used to use the trained ES-GAGFormer model to complete the classification of target imbalanced data nodes.
9. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement a node classification method based on an ES-GAGFormer model as described in any one of claims 1 to 7.
10. A storage medium having stored thereon one or more programs readable by a computing device, characterized in that: The one or more programs include instructions, which, when executed by a computing device, enable the computing device to perform a node classification method based on an ES-GAGFormer model as described in any one of claims 1 to 7.