Anti-structural noise graph open set node classification method and device, electronic equipment and medium

By denoising graph neural networks and learning from courses, the graph structure was optimized, solving the problem that graph neural networks cannot identify unknown categories and adversarial attacks in dynamic scenes, and achieving effective node classification in open environments.

CN121074532BActive Publication Date: 2026-03-03SHENZHEN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511622723.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-07
Publication Date
2026-03-03
Estimated Expiration
2045-11-07

AI Technical Summary

Technical Problem

Existing graph neural networks are unable to effectively identify samples of unknown categories when faced with dynamic and changing real-world scenarios, and are sensitive to graph structure noise and adversarial attacks, resulting in a significant decrease in model performance and limiting their application in open environments.

Method used

By obtaining the node feature matrix and original adjacency matrix of the noisy graph to be classified, the initial GNN model is input to output the embedding vector. After denoising, the vector is input to the target GNN model to output the confidence score. Combining course learning and maximum entropy loss, the graph structure is optimized to enhance the robustness of the model's adversarial edges and distinguish between known classes and pseudo-unknown classes.

Benefits of technology

It effectively identifies samples of unknown categories, enhances the reliability of the model in open environments, reduces the impact of graph structure noise and adversarial attacks, and improves the accuracy and robustness of node classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121074532B_ABST
    Figure CN121074532B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of data processing, in particular to an anti-structure-noise graph open-set node classification method and device, electronic equipment and medium. When a related classification task is received, a node feature matrix and an original adjacency matrix of a noise graph to be classified are acquired, and are input into a preset initial GNN model, and each node embedding vector is output. The original adjacency matrix is denoised according to the embedding vector, and a denoised adjacency matrix is obtained. The node feature matrix and the denoised adjacency matrix are input into a preset target GNN model, the model outputs confidence scores of each node to different categories, including known class scores and pseudo-unknown class scores, and the category determination result of each node is determined according to the two types of scores. The application can effectively deal with graph structure noise, solve the unknown category sample identification problem in an open environment, and improve the classification accuracy and reliability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus, electronic device and medium for classifying open set nodes of a graph with resistance to structural noise. Background Technology

[0002] In today's era of big data, graph data, due to its unique representational capabilities, has become a key tool for modeling complex relationships. Unlike traditional structured data, graph data can naturally and accurately depict the complex interactions between entities through nodes and edges. This characteristic gives it unique advantages in many fields such as social network analysis, bioinformatics, intelligent recommendation systems, and traffic network modeling. However, traditional machine learning methods face significant challenges when processing this non-Euclidean data, while graph learning techniques, by effectively capturing the topological structure and semantic relationships in graph data, have opened up new avenues for solving such problems.

[0003] Node classification, a fundamental task in graph learning, aims to predict the class attributes of unlabeled nodes based on graph structure information and known node labels. It has wide and significant applications in fields such as intelligent transportation, medical diagnosis, and social network analysis. In recent years, Graph Neural Networks (GNNs) have achieved state-of-the-art performance in tasks such as node classification and link prediction by leveraging message passing mechanisms to efficiently propagate and aggregate information between nodes. Representative frameworks such as GCN, GAT, and GraphSAGE have significantly improved the effectiveness of graph representation learning by employing different neighborhood information aggregation strategies. However, existing GNNs are generally based on the Closed-World Assumption, meaning the model only learns samples from known classes. This obviously faces challenges in real-world open-world scenarios. When models are deployed in dynamically changing real-world scenarios, such as academic social networks, newly joined researchers and their relationships often exceed the coverage of the training data. Faced with these samples from unknown classes, traditional GNNs will force these samples from unknown classes to be classified into known classes, leading to a significant drop in model performance. Research has found that insufficient out-of-distribution (OOD) generalization can lead to a 40% drop in model accuracy, severely limiting the reliability of GNNs in practical applications. Currently, there is virtually no work that simultaneously considers graph structure noise and open set recognition in graph data node classification tasks. Regarding graph structure learning, GNN models exhibit significant vulnerability to adversarial attacks; even small perturbations to the graph structure can cause a significant performance drop. To enhance the robustness of GNN models, methods such as graph structure enhancement, adversarial training, robust node representation learning, message passing mechanisms, and utilizing low-rank components in the graph are employed to learn an optimized graph structure from a given graph, mitigating the impact of adversarial edges. It is evident that in tasks such as node classification, GNNs only learn known categories during training and cannot effectively identify samples of unknown categories. When GNNs are deployed in dynamic environments such as social networks, newly added nodes often do not belong to any known category. Traditional GNN models force them into any category, leading to a significant performance drop and severely limiting the application of GNNs in real-world open scenarios. Furthermore, existing GNNs are not robust to graph structure noise and are susceptible to adversarial attacks. Attackers only need to make small perturbations to the graph structure, such as adding or removing a small number of edges, to significantly mislead the model's predictions. The sensitivity to noise may have serious consequences in high-risk fields (such as healthcare and finance). Summary of the Invention

[0004] To overcome the shortcomings of existing technologies, this invention provides a method, apparatus, electronic device, and medium for classifying open set nodes in graphs with structural noise resistance. This method efficiently learns information from noisy graph data, more accurately detects unseen classes and correctly classifies seen classes in real-world environments, and achieves effective classification of nodes in open set scenarios.

[0005] The first aspect of this application provides a method for classifying open set nodes of a graph that is resistant to structural noise, the method comprising:

[0006] When receiving a task to classify open set nodes of a noise-resistant graph, obtain the node feature matrix and the original adjacency matrix of the noise graph to be classified;

[0007] The node feature matrix and the original adjacency matrix are input into a preset initial GNN model so that the initial GNN model outputs the embedding vector of each node.

[0008] The original adjacency matrix is ​​denoised based on the embedding vector of each node to obtain a denoised adjacency matrix.

[0009] The node feature matrix and the denoised adjacency matrix are input into a preset target GNN model so that the target GNN model outputs a confidence score for each node for different categories; the confidence score includes a known class score and a pseudo-unknown class score;

[0010] The category determination result of each node is determined based on the known class score and the pseudo-unknown class score.

[0011] In an optional implementation, the step of denoising the original adjacency matrix based on the embedding vector of each node to obtain a denoised adjacency matrix includes:

[0012] The similarity between the target node and other nodes is calculated based on the embedding vector of each node to obtain a similarity matrix; the target node is any node among all nodes, and the other nodes are all nodes except the target node.

[0013] Remove edges with similarity below a preset threshold from the similarity matrix to obtain the trimmed adjacency matrix;

[0014] For each node, identify multiple similar nodes in the similarity matrix, and add connecting edges between the multiple similar nodes to obtain an adjacency matrix with added edges;

[0015] The denoised adjacency matrix is ​​obtained based on the trimmed adjacency matrix and the adjacency matrix with added edges.

[0016] In an optional implementation, determining the category determination result of each node based on the known class score and the pseudo-unknown class score includes:

[0017] When all known class scores of the target node are below the classification threshold, the target node is determined to belong to the unknown class; the target node can be any node.

[0018] When the target node has at least one known class score higher than the classification threshold, the target node is determined to belong to a known class.

[0019] In an optional implementation, the method further includes:

[0020] Obtain the overall dataset for fine-tuning the initial GNN model; the overall dataset includes the training node feature matrix, the training adjacency matrix, and node label information; divide the overall dataset into a training dataset, a test dataset, and a validation dataset;

[0021] The training adjacency matrix and training node feature matrix from the training dataset are input into the initial GNN model, and the initial GNN model is optimized based on the overall objective loss of open set classification; the overall objective loss consists of label loss and maximum entropy loss.

[0022] After each training iteration, the gradient is calculated based on the overall target loss, and the parameters of the initial GNN model are updated using the optimizer until the preset iteration termination condition is met.

[0023] The initial GNN model that satisfies the preset iteration termination condition is determined as the target GNN model.

[0024] In an optional implementation, the method further includes:

[0025] The overall target loss is determined using the following formula:

[0026] ;

[0027] in, The overall target loss, For the label loss, For the maximum entropy loss, It is a trainable parameter;

[0028] The label loss is determined using the following formula:

[0029] ;

[0030] in, It is a softmax layer consisting of fully connected layers and corresponding activation functions. It represents the number of nodes belonging to the known class. C Indicates the number of known classes. It is the first in the known data i The real label of each node It is the first i The classification prediction scores of the known nodes in class c.

[0031] In an optional implementation, the method further includes:

[0032] At each iteration t, the training adjacency matrix is ​​transformed according to the binary mask matrix. Where ⊙ represents the Hadamarda product, The training adjacency matrix The binary mask matrix;

[0033] The transformed training adjacency matrix and the training node feature matrix are input into the encoder of the initial GNN model to output the node embedding. , For the first t The encoder at the next iteration;

[0034] Reconstructing the model using the decoder of the initial GNN model through residual fitting The reconstructed graph structure is obtained. ;

[0035] The residual graph is calculated based on the difference between the trained adjacency matrix and the reconstructed graph structure. ;

[0036] The learning objective of the initial GNN model is constructed based on the residual plot and the overall target loss.

[0037] In an optional implementation, the method further includes:

[0038] Obtain the predicted probability of each validation set node and the predicted probability of the pseudo-unknown class node output by the target GNN model based on the validation dataset;

[0039] Determine the first maximum prediction probability corresponding to each validation set node, and the second maximum prediction probability corresponding to the pseudo-unknown class node;

[0040] The classification threshold is determined based on the first maximum predicted probability and the second maximum predicted probability.

[0041] A second aspect of this application provides an anti-structural noise graph open set node classification device, the device comprising:

[0042] The acquisition module is used to acquire the node feature matrix and the original adjacency matrix of the noise graph to be classified when receiving an open set node classification task for an anti-structured noise graph;

[0043] The generation module is used to input the node feature matrix and the original adjacency matrix into a preset initial GNN model so that the initial GNN model outputs the embedding vector of each node;

[0044] The denoising module is used to denoise the original adjacency matrix based on the embedding vector of each node to obtain a denoised adjacency matrix.

[0045] The score output module is used to input the node feature matrix and the denoised adjacency matrix into a preset target GNN model, so that the target GNN model outputs the confidence score of each node for different categories; the confidence score includes known class score and pseudo-unknown class score;

[0046] A category determination model is used to determine the category determination result of each node based on the known class scores and the pseudo-unknown class scores.

[0047] A third aspect of this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the anti-structural noise graph open set node classification method.

[0048] A fourth aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described anti-structural noise graph open set node classification method.

[0049] In summary, the structural noise-resistant graph open set node classification method, apparatus, electronic device, and medium provided in this application, upon receiving a structural noise-resistant graph open set node classification task, first obtain the node feature matrix and original adjacency matrix of the noisy graph to be classified, input them into the initial GNN model to obtain the embedding vector of each node, and then denoise the original adjacency matrix based on the embedding vector of each node to obtain a denoised adjacency matrix. The node feature matrix and the denoised adjacency matrix are then input into the target GNN model. Denoising reduces the influence of adversarial edges and enhances the model's robustness to graph structural noise. Furthermore, the target GNN model outputs the confidence score of each node for different categories, including known class scores and pseudo-unknown class scores. The category determination result of each node is determined based on the known class scores and pseudo-unknown class scores. For samples from unknown categories, they are no longer forcibly classified into known categories, but rather the node category is reasonably determined by considering the pseudo-unknown class scores. This solves the problem of identifying unknown category samples in open environments and improves the reliability of the model in real-world open scenarios. Attached Figure Description

[0050] Figure 1 This is a flowchart illustrating an anti-structural noise graph open set node classification method according to an embodiment of this application;

[0051] Figure 2 This is a schematic diagram of an open robust graph learning node classification framework for graph data noise, as illustrated in an embodiment of this application.

[0052] Figure 3 This is a functional block diagram of an anti-structural noise graph open set node classification device shown in an embodiment of this application;

[0053] Figure 4 This is a schematic diagram of the structure of an electronic device shown in an embodiment of this application. Detailed Implementation

[0054] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0055] The following will clearly and completely describe the concept, specific structure, and technical effects of the present invention in conjunction with embodiments and accompanying drawings, so as to fully understand the purpose, features, and effects of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of them. Other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are all within the scope of protection of the present invention. Furthermore, all connections / linkages involved in the patent do not simply refer to direct contact between components, but rather to the ability to form a better connection structure by adding or reducing connecting accessories according to specific implementation conditions. The various technical features in this invention can be combined interactively without contradicting each other.

[0056] Reference Figure 1 The diagram shown is a flowchart illustrating an anti-structural noise graph open set node classification method according to an embodiment of this application. The anti-structural noise graph open set node classification method includes the following steps.

[0057] S11, when receiving the task of classifying open set nodes of anti-structure noise graph, obtain the node feature matrix and the original adjacency matrix of the noise graph to be classified.

[0058] When performing a node classification task on an open set with graph structure noise, the task involves obtaining the node feature matrix and the original graph structure information (i.e., the given original adjacency matrix) of the noisy graph to be classified. Here, node features refer to the values ​​of graph nodes.

[0059] S12, input the node feature matrix and the original adjacency matrix into the preset initial GNN model so that the initial GNN model outputs the embedding vector of each node.

[0060] Because noisy edges in the original graph structure information can severely interfere with model performance, they are also referred to... Figure 2 In the first part, namely stage (a), an encoder is employed to efficiently learn high-quality node representations under the homogeneity assumption (i.e., similar nodes are more likely to belong to the same category) and optimize the original graph structure. This process effectively improves the structural quality of the graph by reducing dissimilar edges (edges connecting nodes of different categories) and enhancing homogeneous edges (edges connecting nodes of the same category). Potential homogeneous and dissimilar edges are identified based on the similarity between nodes, thereby guiding the optimization of the graph structure.

[0061] In this embodiment, the electronic device uses a two-layer GCN as a node feature encoder (i.e., an initial GNN model). This initial GNN model has fixed parameters and requires no training. By fully fusing node attribute information and graph structure information through the initial GNN model, neighbor features are effectively aggregated, thereby learning a more discriminative node embedding representation. This process can be represented as:

[0062] ;

[0063] in, This represents the embedded encoder, which is also the initial GNN model; H X represents the embedding vector corresponding to the node; X represents the node feature matrix. A This represents the adjacency matrix with noise, which is the adjacency matrix obtained in step S11.

[0064] S13, the original adjacency matrix is ​​denoised according to the embedding vector of each node to obtain the denoised adjacency matrix.

[0065] After obtaining high-quality node representations, i.e., obtaining embedding vectors H Then, it is necessary to further optimize the graph structure itself, that is, to enhance the homogeneity of the graph by removing heterogeneous edges and strengthening homogeneous edges.

[0066] In an optional implementation, the step of denoising the original adjacency matrix based on the embedding vectors of each node to obtain a denoised adjacency matrix includes:

[0067] The similarity between the target node and other nodes is calculated based on the embedding vector of each node to obtain a similarity matrix; the target node is any node among all nodes, and the other nodes are all nodes except the target node.

[0068] Remove edges with similarity below a preset threshold from the similarity matrix to obtain the trimmed adjacency matrix;

[0069] For each node, identify multiple similar nodes in the similarity matrix, and add connecting edges between the multiple similar nodes to obtain an adjacency matrix with added edges;

[0070] The denoised adjacency matrix is ​​obtained based on the trimmed adjacency matrix and the adjacency matrix with added edges.

[0071] In some embodiments, the electronic device first uses the embedding vectors obtained during the representation learning phase. H Calculate the cosine similarity of each node to obtain the similarity matrix. :

[0072] ;

[0073] in, and They are nodes and The embedding vector.

[0074] Next, to reduce the impact of noisy edges, the similarity matrix is ​​removed. The similarity is lower than the preset threshold (The value of the edges can be set to 0.3 based on experience) to obtain the trimmed adjacency matrix. :

[0075] ;

[0076] By removing edges with similarity below a preset threshold, edges connecting dissimilar nodes are effectively removed, thereby improving the homogeneity of the graph.

[0077] Furthermore, to enhance the structural information of the graph, an edge addition strategy is introduced. For each node, edges similar to it in the similarity matrix are identified. k A node, that is, for a certain node Calculate the node Calculate the similarity score with all other nodes, sort the other nodes from highest to lowest based on similarity, and select the top k nodes as nodes. Similar nodes; and in nodes and k By establishing edges between similar nodes, we obtain the adjacency matrix of the added edges. :

[0078] ;

[0079] It should be noted that, since the most similarity relation is not symmetric, therefore It is not a symmetric matrix. For example, yes The most similar node is selected, but the reverse is not necessarily true. Pruning strategies cannot eliminate all perturbations, while these insertion operations can effectively reduce the impact of remaining harmful edges. According to experimental results, this is particularly effective when the perturbation rate is high.

[0080] When the trimmed adjacency matrix is ​​obtained Adjacency matrix with added edges Finally, the optimized adjacency matrix can be obtained, which is the denoised adjacency matrix. This not only preserves the key structural characteristics of the original graph, but also strengthens the connections between highly similar nodes, thereby improving the effectiveness of message passing in graph neural networks.

[0081] S14, input the node feature matrix and the denoised adjacency matrix into the preset target GNN model so that the target GNN model outputs the confidence score of each node for different categories.

[0082] Through the refinement of the graph structure in step S12, the structural noise of the noise graph to be classified can be significantly reduced, but some noise will still inevitably remain. To further reduce the impact of these residual noises, refer to... Figure 2 In the second part, namely stage (b), this application introduces a curriculum-based edge learning method to enhance the robustness of the GNN model. Curriculum learning simulates human learning by prioritizing simpler samples and gradually introducing more complex ones. In graph structures, edges that are more difficult to learn are often more likely to be structural noise. Therefore, curriculum learning can improve the model's robustness to graph structural noise by fully fitting "simple and clean" nodes or edges and paying less attention to "complex and noisy" nodes or edges.

[0083] After obtaining the denoised adjacency matrix, this denoised adjacency matrix and the node feature matrix obtained in step S11 are input into the preset target GNN model. The target GNN model is generated by fine-tuning the initial GNN model and is referenced accordingly. Figure 2 The specific fine-tuning steps include:

[0084] (1) Data and model initialization.

[0085] Following the same implementation method as steps S11 and S12, a complete dataset for fine-tuning the initial GNN model is obtained, wherein the complete dataset includes node feature matrices used for training. (referred to as the training node feature matrix) and the denoised adjacency matrix used for training (referred to as the training adjacency matrix), where N For the number of nodes, d This represents the node feature dimension. Simultaneously, node label information is obtained, including the known class label Y, where the number of known classes is C, and the number of nodes belonging to the known classes is [missing information]. Next, the overall dataset is divided into a training dataset, a test dataset, and a validation dataset. The training dataset is used for parameter updates during model fine-tuning. The validation dataset is used to verify the model's training effectiveness. Therefore, when validating model performance on the validation dataset, validation nodes are used to calculate the classification threshold for open-scene scenarios. This classification threshold is automatically calculated during the open-scene classification task; that is, the classification threshold is not transferred from the validation set to the test set, but is calculated separately during the classification task. Therefore, the threshold is not fixed but is automatically calculated based on the classification nodes required. The test set is used for the final evaluation of model performance. Simultaneously, a GNN model (i.e., the initial GNN model) is initialized, which includes an encoder. The encoder is used to map the input adjacency matrix and node feature matrix into latent node embeddings, denoted as the first... t In the next iteration, the encoder is Input the training node feature matrix X and the training adjacency matrix Then, the learned node embeddings are output. ,in , Indicates the dimension of the embedding.

[0086] (2) Pre-training for fine-tuning the graph structure.

[0087] In each iteration t At this time, a learnable binary mask matrix is ​​introduced. S Each element This is to control the learning of edges in each iteration. Iterate until... t The training adjacency matrix at time can be represented as , where ⊙ represents the Hadamarda product.

[0088] In the t In the next iteration, given the currently selected edge, it is input into the encoder to obtain the latent node embedding. That is, the current iteration... t adjacency matrix Input to GNN encoder In, obtain node embedding .

[0089] Next, the graph structure is reconstructed using a decoder through residual fitting. The reconstructed graph structure is obtained. Among them, residual plot Represents the training adjacency matrix With reconstructing the graph structure The difference between them, namely Residual plot As a reliable indicator of how well the current model satisfies the edge expectation, a smaller residual error indicates a higher probability that the edge is aligned with the model expectation.

[0090] To select the minimum number of edges in each iteration, i.e., to constrain the number of edges to retain. K is a parameter that controls the number of edges to be retained. Therefore, a penalty is applied to the residual error of the selected edges. Therefore, the learning objective of the initial GNN model at this stage can be expressed as follows:

[0091] ;

[0092] in, This represents the target loss used to train a GNN model in a node classification task. Intended for mask matrix S The residual error on the selected edge is penalized, while K Control the number of edges to retain. It is a hyperparameter used to balance these two losses.

[0093] (3) Graph learning based on curriculum learning.

[0094] In addition to the term that penalizes the residual error on the edges selected by the mask matrix S, the learning objective also includes the target loss for training the GNN model in the node classification task. .

[0095] To enable the classifier to distinguish samples from outside the distribution, entropy maximum loss is introduced, supplemented by label loss. Under the joint constraint of label loss and entropy maximum loss, the classifier is driven to generate different confidence levels for samples from known and unknown classes. Label loss quantifies the difference between the predicted and true distributions, guiding the model to optimize in the right direction and achieve accurate classification.

[0096] Since unknown class samples only appear in the test data, label loss is ineffective for these samples. To address this limitation, samples with low confidence and high entropy in the known classes are selected as pseudo-unknown samples. Unlike cross-entropy classification loss, entropy maximum loss balances the classification output for each sample, demonstrating superior performance on unknown samples and effectively enhancing the model's generalization ability. Therefore, during fine-tuning, the overall objective loss for open set classification is adopted. The initial GNN model is optimized, and the loss is composed of label loss. and maximum entropy loss Joint composition. Specifically, the overall objective loss of open set classification. It is expressed as follows:

[0097] ;

[0098] in, It is a trainable parameter used to balance the label loss. and maximum entropy loss .

[0099] Label loss It is obtained by minimizing the cross-entropy loss of the training data, specifically as follows:

[0100] ;

[0101] in, It is a softmax layer consisting of fully connected layers and corresponding activation functions. It represents the number of nodes belonging to the known class. CIndicates the number of known classes. It is the first in the known data i The real label of each node It is the first i Known nodes The classification prediction score in class c.

[0102] After each training iteration, based on the classifier's output, a subset of nodes (e.g., the top 10% of nodes with the lowest confidence) are selected as pseudo-unknown class nodes, and random noise (such as Gaussian noise) is introduced into the embeddings of these nodes to generate the final pseudo-unknown class nodes. The maximum entropy loss is used to constrain these nodes by maximizing their entropy and preventing them from being classified into any known class.

[0103] Nodes with higher confidence scores were classified as the known class, and their outputs were discriminative. In contrast, a selected subset of nodes exhibited relatively balanced outputs across all visible classes, similar to the behavior of unknown class nodes. To further distinguish between pseudo-unknown nodes and known class nodes, the electronic device introduced random noise, such as Gaussian noise, into the embeddings of these nodes, i.e.:

[0104] ;

[0105] in, These are the embeddings of selected high-entropy nodes. The outputs of these nodes are almost equal among known classes, similar to pseudo-unknown class nodes.

[0106] After the noise perturbation, final pseudo-unknown class nodes are generated. The electronic device uses maximum entropy loss to constrain these pseudo-unknown class nodes by maximizing their entropy and avoiding them from being classified into any known class, i.e.:

[0107] ;

[0108] Overall, optimizing label loss and maximum entropy loss resembles an adversarial process. On one hand, label loss enhances the classifier's discriminative power; on the other hand, maximizing maximum entropy loss blurs some nodes, aiding in the detection of unknown class nodes. Label Loss and maximum entropy loss Joint optimization was performed throughout the fine-tuning phase.

[0109] The gradient is calculated based on the joint loss. The parameters of the initial GNN model are updated using an optimizer (such as stochastic gradient descent, Adam, etc.). After multiple rounds of iterative training, training stops when the model meets the preset iteration termination conditions (such as the loss function value no longer decreasing significantly, reaching the maximum number of iterations, etc.). The model at this point is the target GNN model, which has the ability to accurately classify graph nodes and effectively distinguish between known and unknown classes of nodes in open-world scenarios.

[0110] (4) Out-of-distribution detection.

[0111] After the target GNN model is trained, it enters the testing phase. The electronic device uses the test dataset to perform out-of-distribution detection on the target GNN model to obtain its output. Then, a softmax layer outputs the cross-class prediction scores. ,in N The number of nodes in the test data. C Given the number of classes, the elements in the matrix Indicates the first i The node belongs to the _th c The probability (confidence score) of the class. In this embodiment, for each test node, the maximum score in its prediction score matrix is ​​selected. And based on the classification threshold Perform node category determination. To determine whether a node belongs to a known or unknown class, the following formula is used:

[0112] ;

[0113] in, From the softmax layer The output obtained.

[0114] It should be noted that the classification threshold These are not preset fixed values, but rather values ​​calculated automatically during model inference by selecting high-confidence and low-confidence nodes. These values ​​are then further used for node classification of known and unknown classes. In other words, when performing open-set node classification tasks on structurally inertial graphs, these values ​​are automatically calculated based on the nodes to be classified in the noisy graph.

[0115] After fine-tuning the target GNN model according to the above steps, in the actual structurally sound graph open set node classification task, when the node feature matrix in the graph data is obtained according to steps S11 and S12... and the adjacency matrix after graph structure fine-tuning (denoising) Then, the node feature matrix X and the denoised adjacency matrix After being fed into the trained target GNN model, the GNN encoder inside the model extracts and transforms features from the input data, generating embedding representations that contain rich information about the nodes. These embedding representations then pass through subsequent processing modules such as the softmax layer. The softmax layer maps the node embedding representations to predicted scores across C classes, where C represents the number of known classes. Finally, the target GNN model outputs the confidence score for each node for each class. ,in This represents the confidence score of the i-th node belonging to the c-th class. The output confidence score includes a known class score and a pseudo-unknown class score. The known class score reflects the probability that a node belongs to each known class, while the pseudo-unknown class score measures the probability that a node belongs to an unknown class.

[0116] S15, determine the category determination result of each node based on the known class score and the pseudo-unknown class score.

[0117] When classifying nodes, the node with the highest confidence score among all the output categories is selected, that is... Compare it with the threshold Compare the probabilities of all known classes; if the probabilities are all below a threshold... If so, the node can be classified as belonging to the unknown class and marked as "Rejection". Otherwise, if there is at least one known class, the probability... Greater than the threshold If the node is classified as the class with the highest prediction probability, then the predicted label is... .

[0118] Among them, threshold The threshold is determined through an automated strategy. In this embodiment, the electronic device uses a validation dataset and pseudo-unknown class nodes generated during training to determine the threshold. Specifically, during the training of the target GNN model, in addition to normal training using known class node data with real labels, pseudo-unknown class nodes are dynamically generated based on the classifier's output. After each training iteration, based on the classifier's prediction results for the known class nodes, a subset of nodes, such as the top 10% with the lowest confidence, are selected as pseudo-unknown class nodes. These pseudo-unknown class nodes exhibit a relatively balanced output across the known classes, similar to the behavior of unknown class nodes.

[0119] The validation dataset contains nodes of known classes, and its data distribution should have a certain similarity to the training set to ensure the reliability of the validation results. After training, the validation dataset is input into the trained GNN model, i.e., the target GNN model. The target GNN model processes the validation set nodes, extracts node features, and generates corresponding node embeddings. These node embeddings are then passed through a softmax layer, which calculates the probability of each node belonging to each known class based on the embedding information. For each validation set node, the highest predicted probability (referred to as the first maximum predicted probability for ease of distinction) is selected. The average of the maximum predicted probabilities of all validation set nodes is calculated and denoted as... The average value This reflects the average prediction confidence of the target GNN model for known class nodes.

[0120] For pseudo-unknown class nodes generated during training, their embeddings are also passed through a softmax layer to calculate the probability that each pseudo-unknown class node belongs to each known class, and the highest predicted probability is selected (for ease of distinction, it is called the second highest predicted probability). The average of the highest predicted probabilities of all pseudo-unknown class nodes is calculated and denoted as . The average value It simulates the model's prediction of unknown class nodes to a certain extent.

[0121] Based on the calculation and The threshold can be determined. :

[0122] .

[0123] threshold Taking into account the model's predictions for known and pseudo-unknown (simulated unknown) class nodes, it can reasonably divide known and unknown class nodes.

[0124] In the graph fine-tuning stage, this application uses a GNN encoder to learn the node features and structural information of noisy graphs and calculate node similarity to fine-tune the graph structure, effectively reducing the interference of noisy edges on the graph structure and laying a good foundation for subsequent learning. In the robust graph learning part based on course learning, the difficulty of edges is quantified and simple edges are selected for learning first, which effectively improves the model's robustness to noise. In the uncertainty learning based on entropy maximum loss, nodes with lower confidence are selected to generate pseudo-unknown class nodes. The model is optimized by combining cross-entropy loss and maximum entropy loss, which significantly enhances the model's ability to identify unknown classes. The decision threshold is automatically calculated based on the output scores of known class and pseudo-unknown class samples, which realizes the effective distinction between known class nodes and unknown class nodes. It can efficiently learn information from noisy graph data, more accurately detect the missing classes and correctly classify the seen classes in real environment, and realize the effective classification of nodes in open set scenarios.

[0125] In some embodiments, in order to verify the performance of this application, three benchmark datasets are used for evaluation in this application embodiment, wherein the main statistics of the datasets are shown in Table 1 below.

[0126] Table 1:

[0127]

[0128] The Cora dataset consists of machine learning papers, containing 2708 sample points, with each node representing a paper. All sample points are divided into 8 categories. The Citeseer dataset contains 3703 papers divided into 6 categories, recording citation and / or cited information between papers. After removing stop words and words with a frequency less than 10 in the documents, 3707 unique words were obtained. The PubMed dataset includes 19717 scientific publications on diabetes from the PubMed database, divided into three categories. The citation network consists of 44338 links. Each publication in the dataset is described by a TF / IDF-weighted word vector from a dictionary of 500 unique words.

[0129] In the experimental setup, the electronic device selected one category as the unknown class for each dataset and used it only for the test set, while the remaining categories were treated as known classes. To verify the robustness of SROGL to graph structure noise, it was tested on two different types of noise (adversarial attack Mettack [Zhang X, Zitnik M. Gnnguard: Defending graphneural networks against adversarial attacks[J]. Advances in neuralinformation processing systems, 2020, 33: 9263-9275.]) and random noise (Wu K, Chow KH, Wei W, et al. Understanding the Impact of Graph Reduction on Adversarial Robustness in Graph Neural Networks[J]. arXiv preprint arXiv:2412.05883, [2024.] and performance under different perturbation rates (0, 0.05, 0.1, 0.2). Regarding data partitioning, 70% of the nodes were randomly selected as the training set, 10% as the validation set, and 20% as the test set, ensuring that unknown class nodes only appeared in the test set. The validation set was used to determine the optimal threshold for identifying unknown classes. Furthermore, all experiments were conducted in an inductive setting, meaning that no information (such as features or other relevant information) about unknown classes in the test set was used during training and evaluation to better reflect real-world application scenarios. To verify the effectiveness of this invention through experiments, this application was compared with the following three baselines.

[0130] 1) Closed set classification methods: GCN_soft, GCN_sig. These methods consist of a GCN and different output layers: GCN_soft uses a softmax layer, while GCN_sig uses multiple 1-vs-reset sigmoids.

[0131] 2) Open set classification methods: GCN_soft_τ, GCN_sig_τ, openWGL, Specifically, GCN_soft_τ and GCN_sig_τ are based on GCN_soft and GCN_sig respectively, and a probability threshold is set. To achieve open set identification. For any node, if the predicted probabilities of all categories satisfy... If the probability is not found, the sample is classified as belonging to the unknown category; otherwise, the category with the highest probability is returned. As a prediction result; OpenWGL and These are two state-of-the-art node classification methods for open graph datasets. OpenWGL employs an uncertainty loss applied to unlabeled data as a graph reconstruction loss, and uses an adaptive threshold to detect samples of unknown class. This is a novel generative open set graph node classification method. By generating pseudo-unknown category nodes, it transforms the original closed set classifier into an open set classifier.

[0132] 3) Graph Structure Learning Methods: STABLE, RNCGLN, and SG-GSR. STABLE is a contrastive learning-based method that obtains node representations through robust data augmentation, thereby refining the graph structure. It effectively captures node structural information and is insensitive to perturbations. RNCGLN considers both label noise and structural noise: it uses graph contrastive loss and a self-attention mechanism for graph learning, and handles structural and label noise separately through pseudo-graphs and pseudo-labels. SG-GSR proposes a self-guided graph structure optimization framework that extracts clean subgraphs through graph augmentation and group training strategies, and trains a robust node classifier.

[0133] The experiments used accuracy (ACC) and area under the ROC curve (AUROC) as evaluation metrics, and the specific results are shown in Tables 2 and 3. Tables 2 and 3 list the results of each experimental method on the open-ended learning node classification task with graph structure noise. Table 2 lists the results for three datasets containing one unknown class and graph structures with MetaAttack attacks, while Table 3 lists the results for three datasets containing one unknown class and graph structures with Random attacks.

[0134] Table 2:

[0135]

[0136] Table 3:

[0137]

[0138] As can be seen, by combining graph structure fine-tuning and course learning training paradigm with maximum entropy loss, this invention can effectively combat graph structure noise and effectively capture label uncertainty in node representation, thus better distinguishing whether a node belongs to a known or unknown class.

[0139] Reference Figure 3 The diagram shown is a functional block diagram of an anti-structural noise graph open set node classification device according to an embodiment of this application.

[0140] In some embodiments, the anti-structural noise graph open set node classification device 30 may include multiple functional modules composed of computer program segments. The computer programs for each program segment of the anti-structural noise graph open set node classification device 30 may be stored in the memory of an electronic device and executed by at least one processor to perform (see details). Figure 1 (Description) The function of classifying open set nodes of a structurally noise-resistant graph. Based on its function, it can be divided into multiple functional modules. These functional modules may include: an acquisition module 301, a generation module 302, a denoising module 303, a score output module 304, a category determination module 305, and a model training module 306. The module referred to in this application is a series of computer program segments that can be executed by at least one processor and perform a fixed function, stored in memory. In this embodiment, the functions of each module will be detailed in subsequent embodiments.

[0141] The acquisition module 301 is used to acquire the node feature matrix and the original adjacency matrix of the noise graph to be classified when receiving the anti-structural noise graph open set node classification task.

[0142] The generation module 302 is used to input the node feature matrix and the original adjacency matrix into a preset initial GNN model so that the initial GNN model outputs the embedding vector of each node.

[0143] The denoising module 303 is used to denoise the original adjacency matrix according to the embedding vector of each node to obtain a denoised adjacency matrix.

[0144] The score output module 304 is used to input the node feature matrix and the denoised adjacency matrix into a preset target GNN model, so that the target GNN model outputs the confidence score of each node for different categories; the confidence score includes known class score and pseudo-unknown class score.

[0145] The category determination module 305 is used to determine the category determination result of each node based on the known class score and the pseudo-unknown class score.

[0146] The denoising module 303 is further specifically configured to: calculate the similarity between the target node and other nodes based on the embedding vector of each node to obtain a similarity matrix; the target node is any node among all nodes, and the other nodes are all nodes except the target node; remove edges in the similarity matrix with similarity below a preset threshold to obtain a pruned adjacency matrix; determine multiple similar nodes for each node in the similarity matrix, and add connecting edges between the multiple similar nodes to obtain an adjacency matrix with added edges; and obtain the denoised adjacency matrix based on the pruned adjacency matrix and the adjacency matrix with added edges.

[0147] The category determination module 305 is further specifically used to: determine that the target node belongs to the unknown class when all known class scores of the target node are lower than the classification threshold; the target node is any node; and determine that the target node belongs to the known class when at least one known class score of the target node is higher than the classification threshold.

[0148] The model training module 306 is configured to: acquire a global dataset for fine-tuning the initial GNN model; the global dataset includes a training node feature matrix, a training adjacency matrix, and node label information; divide the global dataset into a training dataset, a test dataset, and a validation dataset; input the training adjacency matrix and training node feature matrix from the training dataset into the initial GNN model, and optimize the initial GNN model based on the overall objective loss for open set classification; the overall objective loss consists of label loss and maximum entropy loss; after each training iteration, calculate the gradient based on the overall objective loss, and update the parameters of the initial GNN model using an optimizer until a preset iteration termination condition is met; and determine the initial GNN model that meets the preset iteration termination condition as the target GNN model.

[0149] It should be understood that the various variations and specific embodiments of the anti-structural noise graph open set node classification method provided in the above embodiments are also applicable to the anti-structural noise graph open set node classification device of this embodiment. Through the foregoing detailed description of the anti-structural noise graph open set node classification method, those skilled in the art can clearly understand the implementation method of the anti-structural noise graph open set node classification device of this embodiment. For the sake of brevity, it will not be described in detail here.

[0150] See Figure 4 The diagram shown is a schematic representation of the structure of an electronic device according to an embodiment of this application. In a preferred embodiment of this application, the electronic device 4 includes a memory 41, at least one processor 42, and at least one communication bus 43.

[0151] Those skilled in the art should understand that Figure 4The structure of the electronic device shown does not constitute a limitation of the embodiments of this application. It can be a bus structure or a star structure. The electronic device 4 may also include more or fewer other hardware or software than shown, or different component arrangements.

[0152] In some embodiments, the electronic device 4 is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions. Its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), programmable gate arrays (FPGAs), digital processors, and embedded devices. The electronic device 4 may also include user equipment, which includes, but is not limited to, any electronic product capable of human-computer interaction with a user via a keyboard, mouse, remote control, touchpad, or voice control device, such as a personal computer, tablet computer, smartphone, or digital camera.

[0153] In the embodiments provided in this application, it should be understood that the disclosed methods, apparatuses, computer-readable storage media, and electronic devices can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple components or modules may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices, components, or modules may be electrical, mechanical, or other forms.

[0154] The components described as separate parts may or may not be physically separate. The components shown as components may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the components can be selected to achieve the purpose of this embodiment according to actual needs.

[0155] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing module, or each component can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.

[0156] If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0157] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.

[0158] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0159] The above is a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the embodiments described. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of this application.

Claims

1. An anti-structure noise graph open set node classification method, characterized in that, The method comprises: Upon receiving an anti-structure noise graph open set node classification task, obtaining a node feature matrix and an original adjacency matrix of a noise graph to be classified; inputting the node feature matrix and the original adjacency matrix into a preset initial GNN model, so that the initial GNN model outputs an embedding vector of each node; performing denoising processing on the original adjacency matrix according to the embedding vector of each node to obtain a denoised adjacency matrix; inputting the node feature matrix and the denoised adjacency matrix into a preset target GNN model, so that the target GNN model outputs a confidence score of each node for different categories; the confidence score includes a known class score and a pseudo-unknown class score; the target GNN model is determined by the following steps: obtaining an overall data set for fine-tuning the initial GNN model; the overall data set includes a training node feature matrix, a training adjacency matrix, and node label information; dividing the overall data set into a training data set, a test data set, and a validation data set; inputting the training adjacency matrix and the training node feature matrix in the training data set into the initial GNN model, and optimizing the initial GNN model according to the overall target loss of the open set classification; the overall target loss is composed of a label loss and a maximum entropy loss; after each training iteration, the gradient is calculated according to the overall target loss, and the parameters of the initial GNN model are updated using an optimizer until a preset iteration termination condition is met; the initial GNN model that meets the preset iteration termination condition is determined as the target GNN model; determining the category determination result of each node according to the known class score and the pseudo-unknown class score; The method further comprises: obtaining a prediction probability corresponding to each validation set node and a prediction probability corresponding to a pseudo-unknown class node output by the target GNN model based on the validation data set; determining a first maximum prediction probability corresponding to each validation set node and a second maximum prediction probability corresponding to the pseudo-unknown class node; determining a classification threshold according to the first maximum prediction probability and the second maximum prediction probability.

2. The anti-structure noise graph open set node classification method of claim 1, wherein, The denoising processing on the original adjacency matrix according to the embedding vector of each node comprises: calculating the similarity between a target node and other nodes according to the embedding vector of each node to obtain a similarity matrix; the target node is any one of all nodes, and the other nodes are all nodes except the target node; removing edges with a similarity lower than a preset threshold in the similarity matrix to obtain a pruned adjacency matrix; determining a plurality of similar nodes of each node in the similarity matrix, and adding a connection edge between the plurality of similar nodes to obtain an adjacency matrix with added edges; obtaining the denoised adjacency matrix according to the pruned adjacency matrix and the adjacency matrix with added edges.

3. The anti-structure noise graph open set node classification method of claim 2, wherein, The determination of the category determination result of each node according to the known class score and the pseudo-unknown class score comprises: determine that the target node belongs to an unknown class when all known class scores of the target node are lower than a classification threshold; the target node is any one node; determine that the target node belongs to a known class when at least one known class score of the target node is higher than the classification threshold.

4. The anti-structure noise graph open set node classification method of claim 1, wherein, The method further comprises: determine the overall target loss by the following formula: ; wherein, is the overall target loss, is the label loss, is the maximum entropy loss, is a trainable parameter; determine the label loss by the following formula: ; wherein, is a softmax layer composed of a fully connected layer and a corresponding activation function, is the number of nodes belonging to the known class, C denotes the number of known classes, is the true label of the i th node in the known data, is the classification prediction score of the i th known node in the cth class, Y is the node embedding vector, and Z is the node embedding vector.

5. The anti-structure noise graph open set node classification method of claim 1, wherein, The method further comprises: at each iteration t, transforming the training adjacency matrix into a binary matrix according to a binary mask matrix where denotes the Hadamard product, is the training adjacency matrix at iteration t, the training adjacency matrix, is the binary mask matrix; The transformed training adjacency matrix and the training node feature matrix are input into the encoder of the initial GNN model to output node embedding vectors. , For the first t The encoder in the next iteration, X is the feature matrix of the training nodes; reconstructing, by a decoder of the initial GNN model, through residual fitting , to obtain a reconstructed graph structure ; computing a residual graph from a difference between the training adjacency matrix and the reconstructed graph structure ; construct a learning target of the initial GNN model according to the residual graph and the overall target loss.

6. An anti-structure noise map open set node classification apparatus characterized by, The device comprises: An acquisition module is configured to, when a node classification task of an open set of a structure-resistant noise graph is received, acquire a node feature matrix and an original adjacency matrix of a noise graph to be classified; A generation module is configured to input the node feature matrix and the original adjacency matrix into a preset initial GNN model, so that the initial GNN model outputs an embedding vector of each node; A denoising module is configured to perform denoising processing on the original adjacency matrix according to the embedding vector of each node, to obtain a denoised adjacency matrix; A score output module is configured to input the node feature matrix and the denoised adjacency matrix into a preset target GNN model, so that the target GNN model outputs a confidence score of each node for different classes; the confidence score includes a known class score and a pseudo unknown class score; the target GNN model is determined by the following steps: acquiring an overall data set for fine-tuning the initial GNN model; the overall data set includes a training node feature matrix, a training adjacency matrix, and node label information; dividing the overall data set into a training data set, a test data set, and a validation data set; inputting the training adjacency matrix and the training node feature matrix in the training data set into the initial GNN model, and optimizing the initial GNN model according to an overall target loss of open set classification; the overall target loss is composed of a label loss and a maximum entropy loss; after each training iteration, a gradient is calculated according to the overall target loss, and an optimizer is used to update parameters of the initial GNN model until a preset iteration termination condition is met; the initial GNN model that meets the preset iteration termination condition is determined as the target GNN model; A class determination model is configured to determine a class determination result of each node according to the known class score and the pseudo unknown class score. The score output module is further configured to acquire a predicted probability corresponding to each validation set node and a predicted probability corresponding to a pseudo unknown class node output by the target GNN model based on the validation data set; determine a first maximum predicted probability corresponding to each validation set node and a second maximum predicted probability corresponding to the pseudo unknown class node; and determine a classification threshold according to the first maximum predicted probability and the second maximum predicted probability.

7. An electronic device, comprising: A computer program product comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the open set node classification method of the structure-resistant noise graph according to any one of claims 1 to 5 when executing the computer program.

8. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program, when executed by a processor, implements the steps of the anti-structured noise graph open set node classification method of any one of claims 1 to 5.

Citation Information

Patent Citations

  • Label noise-oriented graph node classification method

    CN111966823A

  • Open set classification based on heterogenous model ensemble in multisensor environments

    US20230110993A1