A small-sample attribute graph node classification method based on deep metric learning

Through the small sample attribute graph node classification method of deep metric learning, the simplified graph convolutional network and graph convolutional network are used to calculate the feature vector and weight of the node and determine the classification probability of the node, which solves the problem of low accuracy of graph neural network in small sample node classification and improves the classification efficiency and accuracy.

CN115481696BActive Publication Date: 2025-09-05HENAN UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211192154.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-28
Publication Date
2025-09-05
Estimated Expiration
2042-09-28

AI Technical Summary

Technical Problem

Existing graph neural networks have low accuracy in classifying small sample nodes, and require time and resources to relearn new information, making it difficult to effectively classify nodes.

Method used

A small-sample attribute graph node classification method based on deep metric learning is adopted. By obtaining the adjacency matrix and feature matrix of network data, and using simplified graph convolutional networks and graph convolutional networks, the feature vectors, weights and scaled metric distances of the nodes are calculated to determine the classification probability of the nodes.

Benefits of technology

The accuracy of small sample node classification is improved, data labeling time is reduced, and good classification performance and efficiency are maintained.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115481696B_ABST
    Figure CN115481696B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of graph mining technology, and in particular to a small sample attribute graph node classification method based on deep metric learning, comprising: obtaining an adjacency matrix and a feature matrix corresponding to network data, and preprocessing the adjacency matrix corresponding to the network data; determining the feature vectors of each node corresponding to the network data, and determining the initial weight of each node based on the number of nearest neighbor nodes and the number of second-order neighbor nodes of each node; determining the score of each node, and determining the weight of each node corresponding to the network data based on the initial weight and score of each node; determining the prototype of each class corresponding to the network data based on the feature vector and weight of each node corresponding to the network data; obtaining the classification probability of each query node, and determining the category to which each query node belongs based on the classification probability. The present invention is applied to the field of graph data node classification, can effectively handle small sample node classification tasks, and improve the accuracy of attribute graph node classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of graph mining technology, and in particular to a small sample attribute graph node classification method based on deep metric learning. Background Art

[0002] Graphs, as non-Euclidean data, are very common in real life and are widely used to represent network structures of connected data. Real-world entities often form complex graphs, such as transportation networks, e-commerce graphs, citation networks, and social networks. Many tasks can be formulated as instances of node classification, such as finding people with similar interests in social networks and inferring paper topics from citation networks.

[0003] Currently, GNN (Graph Neural Network) can be used to effectively classify nodes, but this method still has some challenges: first, when the number of labeled samples is limited, the performance of the model will be severely degraded; second, when faced with new tasks, the model parameters always need to be relearned to incorporate new information, which leads to poor final classification effect and inaccurate classification results; finally, labeling data is easy to consume time and resources. Summary of the Invention

[0004] In order to solve the technical problem of poor accuracy in the existing attribute graph node classification, the present invention aims to provide a small sample attribute graph node classification method based on deep metric learning. The technical solution adopted is as follows:

[0005] An embodiment of the present invention provides a small sample attribute graph node classification method based on deep metric learning, the method comprising the following steps:

[0006] Obtain the adjacency matrix and feature matrix corresponding to the network data, and preprocess the adjacency matrix corresponding to the network data;

[0007] Obtain a pre-built simplified graph convolutional network, input the feature matrix corresponding to the network data and the pre-processed adjacency matrix into the simplified graph convolutional network of m layers, and obtain the feature vectors of each node corresponding to the network data;

[0008] Obtain the number of nearest neighbor nodes and second-order neighbor nodes of each node corresponding to the network data, and determine the initial weight of each node based on the number of nearest neighbor nodes and second-order neighbor nodes of each node;

[0009] Obtain a pre-built graph convolutional network, input the adjacency matrix and feature matrix corresponding to the network data into the l-layer graph convolutional network to obtain the score of each node; based on the initial weight and score of each node, determine the weight of each node corresponding to the network data;

[0010] Determine the prototypes of various types of network data according to the feature vectors and weights of each node corresponding to the network data;

[0011] A query node set is obtained, and a scaled metric distance between each query node in the query node set and a prototype of each class is calculated. The classification probability of each query node is determined according to the scaled metric distance, and then the class to which each query node belongs is determined.

[0012] Furthermore, the steps of preprocessing the adjacency matrix corresponding to the network data include:

[0013] According to the adjacency matrix and the identity matrix corresponding to the network data, the adjacency matrix is ​​added to the identity matrix to obtain the adjacency matrix after self-connection;

[0014] According to the self-connected adjacency matrix corresponding to the network data and its corresponding degree matrix, the normalized adjacency matrix is ​​obtained.

[0015] Furthermore, the step of obtaining the feature vector of each node corresponding to the network data includes:

[0016] Initialize the model parameters of the pre-built simplified graph convolutional network;

[0017] According to the feature matrix corresponding to the network data, the normalized adjacency matrix and the weight matrix used for training in the initialized simplified graph convolutional network, the feature vector of each node corresponding to the network data is obtained. The calculation formula is:

[0018]

[0019] Among them, Z is the characteristic vector of each node corresponding to the network data, σ() is the nonlinear activation function, is the normalized adjacency matrix corresponding to the network data, m is a hyperparameter, W is the weight matrix used for training in the simplified graph convolutional network, and X is the feature matrix corresponding to the network data.

[0020] Furthermore, the step of determining the initial weight of each node includes:

[0021] Determine the importance index of each node based on the number of its nearest neighbor nodes and the number of its second-order neighbor nodes;

[0022] According to the importance index of each node, the cumulative sum of the importance indexes of each node of the same class is calculated, the cumulative sum is used as the denominator of the ratio, the importance index of each node of the same class is used as the numerator of the ratio, and the ratio is used as the initial weight of the corresponding node.

[0023] Furthermore, the steps of obtaining the scores of each node include:

[0024] According to the adjacency matrix after self-connection corresponding to the network data, the degree matrix corresponding to the adjacency matrix after self-connection, the hidden representation of the nodes in the previous layer of the graph convolution network, and the weight matrix of the previous layer of the graph convolution network, the hidden representation of the nodes in the next layer of the graph convolution network is determined, and then the hidden representation of the nodes in each layer of the graph convolution network is determined;

[0025] Obtain a learnable weight vector and determine the score of each node of the graph convolutional network based on the hidden representation, preset bias, and weight vector of each layer of the graph convolutional network.

[0026] Furthermore, the step of determining the weight of each node corresponding to the network data includes:

[0027] According to the initial weight and score of each node, the product of the initial weight and score of each node is calculated, and the product is normalized using a normalized exponential function to obtain a normalized product, which is used as the weight of the corresponding node.

[0028] Furthermore, the steps of determining the prototypes of various types corresponding to the network data include:

[0029] According to the feature vectors and weights of each node corresponding to the network data, the cumulative value of the product of the feature vectors and weights of each node of the same class is calculated, and the cumulative value is used as the prototype of the corresponding class.

[0030] Furthermore, the calculation formula for determining the classification probability of each query node based on the scaled metric distance is:

[0031]

[0032] in, is the probability that the i-th query node belongs to the c-th class, c is the c-th class, l c To support the prototype of the cth class in the set, is the i-th query node in the query node set, is the feature vector of the i-th query node in the query node set, λ is the scaling parameter, d() is the distance metric function, exp() is the exponential function with a natural constant as the base, C is the set of all classes including the c-th class in the support set, l c′ is the prototype of the c′th class in the support set.

[0033] The present invention has the following beneficial effects:

[0034] The present invention provides a small sample attribute graph node classification method based on deep metric learning. For graph data, based on graph mining technology, small sample learning is used to learn prior knowledge and use limited labeled samples to solve new tasks, effectively overcoming the difficulty of insufficient labeled data. By performing data analysis on the adjacency matrix and feature matrix corresponding to the network data, the eigenvector and weight of each node are obtained, and the prototypes of each class corresponding to the network data are determined. The prototype of the class is analyzed from two aspects, and the prototype of the class is aggregated by the eigenvector and node importance of the nodes in the same class, effectively improving the accuracy of small sample node classification. The classification probability of the query node is determined according to the scaled metric distance, and then the category to which the query node belongs is determined. The scaled metric between the query node and the prototype of the class is used to obtain the category to which the query node belongs. The final classification result of the query node is obtained according to the classification probability. The category to which the query node belongs obtained based on the specific probability index is compared with the graph neural network classification method. It can better maintain good classification performance, improve classification effect and classification accuracy, reduce the time used for data labeling, and improve the efficiency of attribute graph node classification. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0036] Figure 1 This is a flowchart of a small sample attribute graph node classification method based on deep metric learning in the present invention. DETAILED DESCRIPTION

[0037] To further illustrate the technical means and effects employed by the present invention to achieve its intended objectives, the following, in conjunction with the accompanying drawings and preferred embodiments, describes in detail the specific implementations, structures, features, and effects of the technical solutions proposed by the present invention. In the following description, references to "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.

[0038] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0039] This embodiment provides a small sample attribute graph node classification method based on deep metric learning, such as Figure 1 As shown, the method includes the following steps:

[0040] (1) Obtain the adjacency matrix and feature matrix corresponding to the network data, and preprocess the adjacency matrix corresponding to the network data.

[0041] In this embodiment, network data is collected and the adjacency matrix of the network data is preprocessed, specifically: the Amazon-Clothing dataset and the Amazon-Electronics dataset in the e-commerce network and the DBLP (Digital Bibliography Library Project, academic paper dataset) dataset in the citation network, three attribute graph datasets are selected. The number of categories corresponding to these three attribute graph datasets is different, and the datasets are divided into training set, validation set and test set based on the number of categories. The nodes of the Amazon-Clothing dataset have a total of 77 categories, which are divided according to the ratio of 40:17:20; the nodes of the Amazon-Electronics dataset have a total of 167 categories, which are divided according to the ratio of 90:37:40; the nodes of the DBLP dataset have a total of 137 categories, which are divided according to the ratio of 80:27:30. In order to facilitate the subsequent feature vector analysis of the nodes, the adjacency matrices corresponding to the three attribute graph datasets are preprocessed, and the preprocessing content includes but is not limited to normalization. The steps of normalizing the adjacency matrix corresponding to the network data include:

[0042] (1-1) According to the adjacency matrix and the unit matrix corresponding to the network data, the adjacency matrix is ​​added to the unit matrix to obtain the adjacency matrix after self-connection.

[0043] In order to enhance the data characteristics of the adjacency matrix, the adjacency matrix corresponding to the network data is added with self-connection, that is, the adjacency matrix corresponding to the network data and the unit matrix are added together to obtain the adjacency matrix after self-connection. The calculation formula is:

[0044]

[0045] in, is the adjacency matrix after self-connection, A is the adjacency matrix corresponding to the network data, and I is the unit matrix.

[0046] It should be noted that the number of rows and columns of the identity matrix is ​​consistent with the number of rows and columns of the adjacency matrix. If the number of rows and columns of the adjacency matrix is ​​M*M, then the number of rows and columns of the identity matrix is ​​also M*M.

[0047] (1-2) According to the self-connected adjacency matrix corresponding to the network data and its corresponding degree matrix, a normalized adjacency matrix is ​​obtained.

[0048] In order to facilitate subsequent data analysis, based on the self-connected adjacency matrix and its corresponding degree matrix corresponding to the network data, and using the relevant basic knowledge of the nodes corresponding to the network data, the normalized adjacency matrix can be obtained. The calculation formula is:

[0049]

[0050] in, is the normalized adjacency matrix, is the adjacency matrix after self-connection The degree matrix of is the adjacency matrix after self-connection.

[0051] (2) Obtain a pre-built simplified graph convolutional network, input the feature matrix corresponding to the network data and the pre-processed adjacency matrix into the simplified graph convolutional network of m layers, and obtain the feature vectors of each node corresponding to the network data. The steps include:

[0052] (2-1) Initialize the model parameters of the pre-built simplified graph convolutional network.

[0053] First, a pre-built simplified graph convolutional network is obtained. The simplified graph convolutional network can be used to learn the feature vectors of all nodes in the attribute graph. The feature vectors can also become feature representations. To improve the convolution effect of the simplified graph convolutional network, this embodiment initializes the model parameters of the simplified graph convolutional network and sets a small sample classification task. The small sample classification task can include N-way K-shot, the number of layers of the SGC (Simple Graph Convolution) network is m, and the number of layers of the GCN (graph convolutional network) network is l.

[0054] It should be noted that the process of constructing a simplified graph convolutional network is a prior art and is not within the scope of protection of this invention, and will not be elaborated here.

[0055] (2-2) According to the feature matrix corresponding to the network data, the normalized adjacency matrix and the weight matrix used for training in the initialized simplified graph convolutional network, the feature vectors of each node corresponding to the network data are obtained.

[0056] In this embodiment, to obtain the eigenvector of a node, it is necessary to input the eigenmatrix corresponding to the network data and the normalized adjacency matrix into the initialized simplified graph convolutional network, and output the eigenvector of each node corresponding to the network data. The calculation formula for the eigenvector of each node corresponding to the network data can be:

[0057]

[0058] Among them, Z is the characteristic vector of each node corresponding to the network data, σ() is the nonlinear activation function, is the normalized adjacency matrix corresponding to the network data, m is a hyperparameter, W is the weight matrix used for training in the simplified graph convolutional network, and X is the feature matrix corresponding to the network data.

[0059] It should be noted that the hyperparameter m indicates that nodes in the simplified graph convolutional network can aggregate information from their m-hop neighbors. The eigenvectors of each node are affected by the feature matrix and adjacency matrix. To improve the accuracy of the eigenvectors of each node corresponding to the network data, it is necessary to ensure the accuracy of the feature matrix and adjacency matrix corresponding to the network data. In addition, the accuracy of the eigenvectors is also related to the training effect of the simplified graph convolutional network. The better the training effect of the simplified graph convolutional network, that is, the more accurate the weight matrix, the more accurate the eigenvectors will be.

[0060] (3) Obtain the number of nearest neighbor nodes and second-order neighbor nodes of each node corresponding to the network data, and determine the initial weight of each node based on the number of nearest neighbor nodes and second-order neighbor nodes of each node.

[0061] First of all, it should be noted that the importance of nodes in network data is often different. The importance is also an importance index. According to the different importance of the nodes, the importance of the nodes of the same class is normalized. When calculating the weighted sum of the nodes of the same class, the prototype of each class can be obtained. The prototype of a class refers to the prototype representation of the class. First, the number of nearest neighbor nodes and the set of nearest neighbor nodes corresponding to each node in the network data are obtained. Obtaining the number of nearest neighbor nodes and the set of nearest neighbor nodes of a node is an existing technology and will not be elaborated here. Based on the number of nearest neighbor nodes and the set of nearest neighbor nodes of each node, the initial weight of each node can be determined. The steps include:

[0062] (3-1) Determine the importance index of each node based on the number of its nearest neighbor nodes and the number of its second-order neighbor nodes.

[0063] In this embodiment, the importance of a node is not only related to the number of its nearest neighbor nodes, but also to the number of its second-order neighbor nodes. The second-order neighbor nodes refer to the neighbor nodes of the node's nearest neighbor nodes. Therefore, the calculation formula for determining the importance index of each node is:

[0064]

[0065] Among them, Q(i) is the importance index of the i-th node, N(i) is the number of nearest neighbor nodes of the i-th node, Γ iis the set of nearest neighbor nodes of the i-th node, and N(w) is the number of neighbor nodes of the w-th nearest neighbor node of the i-th node.

[0066] (3-2) Based on the importance index of each node, calculate the cumulative sum of the importance indexes of each node of the same class, use the cumulative sum as the denominator of the ratio, use the importance index of each node of the same class as the numerator of the ratio, and use the ratio as the initial weight of the corresponding node.

[0067]

[0068] in, is the initial weight of the i-th node, Q(i) is the importance index of the i-th node, Q(j) is the importance index of the j-th node in the support set that belongs to the same class as the i-th node, For the support set.

[0069] It should be noted that the process of calculating the initial weight of the node is also a normalization process, which keeps the value range of the initial weight of the node between 0 and 1. The normalization process helps to subsequently calculate the weight of each node corresponding to the network data.

[0070] (4) Obtain a pre-built graph convolutional network, input the adjacency matrix and feature matrix corresponding to the network data into the graph convolutional network of layer 1 to obtain the score of each node; determine the weight of each node corresponding to the network data based on the initial weight and score of each node, the steps include:

[0071] (4-1) Obtain a pre-built graph convolutional network, input the adjacency matrix and feature matrix corresponding to the network data into the l-layer graph convolutional network, and obtain the score of each node.

[0072] It should be noted that the corresponding score of each node is learned through the l-layer graph convolutional network and the linear layer. That is, the graph convolutional network can take into account the feature representation of the node and its neighboring nodes and reduce the feature dimension by inputting the data set: the adjacency matrix A and the feature matrix X. The construction process of the graph convolutional network is a prior art and is not within the scope of protection of the present invention. It will not be elaborated here. The steps of obtaining the score of each node include:

[0073] (4-1-1) According to the adjacency matrix after self-connection corresponding to the network data, the degree matrix corresponding to the adjacency matrix after self-connection, the hidden representation of the nodes in the previous layer of the graph convolutional network, and the weight matrix of the previous layer of the graph convolutional network, the hidden representation of the nodes in the next layer of the graph convolutional network is determined, and then the hidden representation of the nodes in each layer of the graph convolutional network is determined. The calculation formula of the hidden representation of the nodes in the next layer is:

[0074]

[0075] Among them, H (l+1) is the hidden representation of the l+1th layer node of the graph convolutional network, σ() is the nonlinear activation function, is the adjacency matrix after self-connection The degree matrix of is the adjacency matrix after self-connection, H (l) is the hidden representation of the l-th layer node of the graph convolutional network, H (l) ∈R n×d , R is the network data, n is the number of nodes in the network data, d is the dimension of the embedded features corresponding to the network data, W (l) is the weight matrix corresponding to the lth layer of the graph convolutional network.

[0076] (4-1-2) Obtain a learnable weight vector and determine the score of each node in the graph convolutional network based on the hidden representation, preset bias, and weight vector of each layer of the graph convolutional network. The calculation formula is:

[0077]

[0078] Among them, s i is the score of the i-th node, is the transpose of a learnable weight vector, h i is the hidden representation of the i-th node in each node layer of the graph convolutional network, b s is the preset bias.

[0079] It should be noted that h i It can be the i-th row of the l-th layer of the graph convolutional network, which represents the hidden representation of the i-th node.

[0080] (4-2) Determine the weight of each node corresponding to the network data based on the initial weight and score of each node, the steps include:

[0081] According to the initial weight and score of each node, the product of the initial weight and score of each node is calculated, and the product is normalized using a normalized exponential function to obtain a normalized product, which is used as the weight of the corresponding node.

[0082] In this embodiment, the weights of nodes belonging to the same class are calculated. The importance of each node is measured by multiplying the initial weight of each node by its corresponding score. The weights are normalized using the softmax (normalized exponential function) function, and the product after normalization is used as the final weight of the node. The calculation formula is:

[0083]

[0084] Among them, a i is the weight of the i-th node, is the initial weight of the i-th node, s i is the score of the i-th node, is the initial weight of the kth node in the support set that belongs to the same class as the i-th node, s k is the fraction of the kth node in the support set that belongs to the same class as the i-th node, For the support set, exp() is an exponential function with a natural constant as its base.

[0085] At this point, the weights of each node corresponding to the network data have been obtained. It is worth noting that analyzing the weights of nodes from the two perspectives of node scores and initial weights can help improve the referenceability and accuracy of node weights, and facilitate the subsequent determination of various prototypes corresponding to the network data.

[0086] (5) According to the feature vectors and weights of each node corresponding to the network data, the prototypes of each category corresponding to the network data are determined.

[0087] According to the feature vectors and weights of each node corresponding to the network data, the cumulative value of the product of the feature vectors and weights of each node of the same class is calculated, and the cumulative value is used as the prototype of the corresponding class.

[0088] In this embodiment, determining the prototype of the class corresponding to the network data is to determine the representation vector of the prototype of the class. According to the feature vector of each node corresponding to the network data obtained in step (2-2) and the weight of each node corresponding to the network data obtained in step (4-2), the prototype representation of all classes in the support set can be calculated. The calculation formula is:

[0089]

[0090] Among them, l c For the prototype of the cth class in the support set, z i is the eigenvector of the i-th row of Z, which represents the eigenvector of the i-th node corresponding to the network data. Z is the eigenvector of each node corresponding to the network data. i is the weight of the i-th node corresponding to the network data, is the set of nodes in the support set that belong to the same class as the i-th node.

[0091] It should be noted that when determining the prototype of a class, based on the importance of each node among similar nodes, it is helpful to accurately classify small sample nodes and improve the accuracy of node classification.

[0092] (6) Obtaining a query node set, calculating the scaled metric distance between each query node in the query node set and the prototype of each class, determining the classification probability of each query node based on the scaled metric distance, and then determining the class to which each query node belongs.

[0093] In this embodiment, obtaining a query node is to obtain a node to be classified. Query nodes can also be called unlabeled nodes. Classification is performed based on the scaled metric distance between each query node and the prototype of each class. The class closest to the query node is identified as the class to which the query node belongs. Taking the determination of the class to which the i-th query node in the query node set belongs as an example, the probability that the i-th query node belongs to the c-th class is first calculated. The calculation formula is:

[0094]

[0095] in, is the probability that the i-th query node belongs to the c-th class, c is the c-th class, l c To support the prototype of the cth class in the set, is the i-th query node in the query node set, is the feature vector of the i-th query node in the query node set, λ is the scaling parameter, d() is the distance metric function, exp() is the exponential function with a natural constant as the base, C is the set of all classes including the c-th class in the support set, l c′ is the prototype of the c′th class in the support set.

[0096] It should be noted that the "c" in the cth class in the support set can be equal to 1, 2, 3, ..., N, where N refers to the total number of classes in the support set. Therefore, the probability that the i-th query node in the query node set belongs to each class is calculated, and the class with the maximum probability corresponding to the i-th query node is used as the classification result for the i-th query node. In other words, the i-th query node belongs to the class with the maximum probability. The classification result refers to the predicted class of the i-th query node. Referencing the process for determining the class to which the i-th query node in the query node set belongs, the class to which each query node in the query node set belongs is determined.

[0097] At the same time, during the training process of the multi-classification model, the loss function of the model is analyzed. In order to minimize the error between the predicted category and the true category of the query node set, this embodiment uses the average negative log-likelihood probability of assigning the correct class label as the training loss, which is calculated as follows:

[0098]

[0099] in, is the training loss of the multi-classification model, N is the total number of prototypes in the support set, K is the total number of query nodes in the query node set, is the probability that the i-th query node is the true label corresponding to the i-th query node, is the true label corresponding to the i-th query node, is the i-th query node in the query node set, and ln() is a logarithmic function with the natural constant e as the base.

[0100] After determining the classification results for each query node, common classification metrics are used to evaluate the classification results. These metrics include classification accuracy, precision, recall, and the F1 score, a metric used in statistics to measure the accuracy of multi-classification models. The maximum value of these four classification metrics is 1, and the minimum value is 0. Generally, the closer the classification metric corresponding to the query node's category is to 1, the better the classification performance of that query node.

[0101] This embodiment provides a small sample attribute graph node classification method based on deep metric learning. The prototype representation of the class is aggregated through the feature vectors and node importance of nodes in the same class, and the classification of the query node is obtained by the scaling between the query node and the prototype of the class. It can effectively improve the accuracy of small sample node classification.

[0102] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application, and should all be included in the scope of protection of the present application.

Claims

1. A small-sample attribute graph node classification method based on deep metric learning, which is applied to the Amazon-Clothing dataset and the Amazon-Electronics dataset in the e-commerce network and the DBLP dataset in the citation network. The method is characterized by: The following steps are involved: Obtain the adjacency matrix and feature matrix corresponding to the network data, and preprocess the adjacency matrix corresponding to the network data; Obtain a pre-built simplified graph convolutional network, input the feature matrix corresponding to the network data and the pre-processed adjacency matrix into the simplified graph convolutional network of m layers, and obtain the feature vectors of each node corresponding to the network data; Obtain the number of nearest neighbor nodes and second-order neighbor nodes of each node corresponding to the network data, and determine the initial weight of each node based on the number of nearest neighbor nodes and second-order neighbor nodes of each node; Obtain a pre-built graph convolutional network, input the adjacency matrix and feature matrix corresponding to the network data into the l-layer graph convolutional network to obtain the score of each node; based on the initial weight and score of each node, determine the weight of each node corresponding to the network data; Determine the prototypes of various types of network data according to the feature vectors and weights of each node corresponding to the network data; A query node set is obtained, and a scaled metric distance between each query node in the query node set and a prototype of each class is calculated. The classification probability of each query node is determined according to the scaled metric distance, and then the class to which each query node belongs is determined.

2. A small sample attribute graph node classification method based on deep metric learning according to claim 1, characterized in that: The steps of preprocessing the adjacency matrix corresponding to the network data include: According to the adjacency matrix and the identity matrix corresponding to the network data, the adjacency matrix is ​​added to the identity matrix to obtain the adjacency matrix after self-connection; According to the self-connected adjacency matrix corresponding to the network data and its corresponding degree matrix, the normalized adjacency matrix is ​​obtained.

3. The small sample attribute graph node classification method based on deep metric learning according to claim 1 is characterized in that: The steps of obtaining the feature vector of each node corresponding to the network data include: Initialize the model parameters of the pre-built simplified graph convolutional network; According to the feature matrix corresponding to the network data, the normalized adjacency matrix and the weight matrix used for training in the initialized simplified graph convolutional network, the feature vector of each node corresponding to the network data is obtained. The calculation formula is: Among them, Z is the characteristic vector of each node corresponding to the network data, ( ) is a nonlinear activation function, is the normalized adjacency matrix corresponding to the network data, m is a hyperparameter, W is the weight matrix used for training in the simplified graph convolutional network, and X is the feature matrix corresponding to the network data.

4. The small sample attribute graph node classification method based on deep metric learning according to claim 1 is characterized in that: The steps to determine the initial weight of each node include: Determine the importance index of each node based on the number of its nearest neighbor nodes and the number of its second-order neighbor nodes; According to the importance index of each node, the cumulative sum of the importance indexes of each node of the same class is calculated, the cumulative sum is used as the denominator of the ratio, the importance index of each node of the same class is used as the numerator of the ratio, and the ratio is used as the initial weight of the corresponding node.

5. The small sample attribute graph node classification method based on deep metric learning according to claim 1 is characterized in that: The steps to get the score of each node include: According to the adjacency matrix after self-connection corresponding to the network data, the degree matrix corresponding to the adjacency matrix after self-connection, the hidden representation of the nodes in the previous layer of the graph convolution network, and the weight matrix of the previous layer of the graph convolution network, the hidden representation of the nodes in the next layer of the graph convolution network is determined, and then the hidden representation of the nodes in each layer of the graph convolution network is determined; Obtain a learnable weight vector and determine the score of each node of the graph convolutional network based on the hidden representation, preset bias, and weight vector of each layer of the graph convolutional network.

6. A small sample attribute graph node classification method based on deep metric learning according to claim 1, characterized in that: The steps of determining the weight of each node corresponding to the network data include: According to the initial weight and score of each node, the product of the initial weight and score of each node is calculated, and the product is normalized using a normalized exponential function to obtain a normalized product, which is used as the weight of the corresponding node.

7. The small sample attribute graph node classification method based on deep metric learning according to claim 1 is characterized in that: The steps to determine the prototypes of various types corresponding to network data include: According to the feature vectors and weights of each node corresponding to the network data, the cumulative value of the product of the feature vectors and weights of each node of the same class is calculated, and the cumulative value is used as the prototype of the corresponding class.

8. The small sample attribute graph node classification method based on deep metric learning according to claim 1 is characterized in that: The calculation formula for determining the classification probability of each query node based on the scaled metric distance is: in, is the probability that the i-th query node belongs to the c-th class, c is the c-th class, l c To support the prototype of the cth class in the set, is the i-th query node in the query node set, is the feature vector of the i-th query node in the query node set, is the scaling parameter, d() is the distance metric function, exp() is the exponential function with a natural constant as the base, C is the set of all classes in the support set including the cth class, To support the centralized The prototype of a class.

Citation Information

Patent Citations

  • GCN-based attribute multilayer network representation learning method

    CN112529168A

  • Interactive community search method and device based on graph neural network

    CN112966165A