Cross-network node classification method, device and medium based on graph contrastive learning

By using the MAGCL model, multi-head graph attention network and graph contrast learning, the stability and class conditional distribution matching problems in cross-network node classification are solved, achieving efficient node label prediction under unsupervised conditions and improving the accuracy of cross-network node classification.

CN116304866BActive Publication Date: 2026-07-21HAINAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HAINAN UNIV
Filing Date
2023-05-09
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing cross-network node classification algorithms lack stability when classifying nodes across different networks, cannot effectively resist network structural noise, and cannot guarantee the matching of class condition distributions across different networks, especially in the absence of label information.

Method used

A cross-network node classification method based on graph contrastive learning is adopted. Through the MAGCL model, an adaptive edge weight calculation is performed using a multi-head graph attention network. The learnable parameters of the graph encoder and domain discriminator are optimized by combining node classification loss, domain classification loss, specific network graph contrastive loss and cross-network graph contrastive loss, so as to achieve end-to-end node label prediction.

Benefits of technology

It improves the stability of cross-network node classification, enhances resistance to network structure noise, and can match the category condition distribution of the source and target networks under unsupervised conditions, thereby improving the accuracy of node classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116304866B_ABST
    Figure CN116304866B_ABST
Patent Text Reader

Abstract

The application discloses a cross-network node classification method and device based on graph contrast learning, equipment and medium, including: adaptive edge weight calculation is carried out to source network historical node and target network node to be classified, and source network historical node feature and target network node feature to be classified are obtained, node classification loss function is constructed based on label prediction probability and real label of source network historical node, and domain classification loss function is constructed according to real domain label of source network historical node and target network node to be classified;Based on the generated positive and negative sample pair, a specific network graph contrast loss function and a cross-network graph contrast loss function are constructed;Based on node classification loss, domain classification loss and graph contrast loss, a target function is constructed;Judge whether the target function meets the convergence condition, if it meets, node label prediction is carried out to the target network node to be classified, the cross-network node classification stability and network structure noise resistance can be improved, and the source network and target network category condition distribution are matched.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of graph contrastive learning and graph neural networks, and particularly to a method, apparatus, device, and medium for cross-network node classification based on graph contrastive learning. Background Technology

[0002] Node classification has always been a highly researched topic in graph machine learning, and has been widely applied in fields such as social networks, biomedicine, and e-commerce. Existing node classification algorithms generally focus on single-network applications, assuming that both training and test nodes are sampled from a single network. However, in practical applications, node classification can be performed across different networks, meaning that training and test nodes are sampled from networks with different data distributions. Cross-network node classification has a variety of real-world applications. For example, in the cross-network influence maximization problem, all nodes in a small source network have labels reflecting their influence, while all nodes in a large target network lack labels. To maximize the influence of the target network, we can transfer knowledge learned from the source network to the target network to help it select the most influential nodes. In the cross-domain protein function prediction problem, given a protein-protein interaction source network with abundant protein function labels and a protein-protein interaction target network lacking protein function labels, we can transfer knowledge learned from the source network to help the target network predict protein functions. In cross-domain recommendation tasks, given a source social network with rich user interest labels and a target social network lacking user interest labels, we can transfer knowledge learned from the source network to help the target network predict user interests. Existing cross-network node classification algorithms generally adopt a combination of graph neural networks and domain adaptation. On the one hand, this solves the problem that graph neural networks lack consideration of inter-domain distribution differences, and on the other hand, it solves the problem that domain adaptation algorithms lack consideration of network topology. However, existing cross-network node classification algorithms still have the following shortcomings: (1) Existing cross-network node classification algorithms generally adopt graph neural network models with fixed edge weights, which have low resistance to network structure noise. (2) Most existing cross-network node classification algorithms only focus on matching the edge distributions of the source and target networks, but cannot guarantee the matching of class conditional distributions of different networks, that is, they cannot guarantee that nodes of the same category have similar representations in different networks. In graph data analysis, labels are often expensive, limited, or even unavailable. In order to utilize a large amount of unlabeled graph data, graph contrastive learning has recently provided a promising paradigm. By combining graph neural networks with contrastive learning, graph representations can be learned unsupervised without relying on label information. Although graph contrast learning has demonstrated superior performance in unsupervised graph representation learning for single networks, its application to cross-network node classification remains unexplored.

[0003] As can be seen from the above, how to improve the stability of cross-network node classification, enhance resistance to network structure noise, and achieve matching of the category conditional distribution of the source network and the target network are problems to be solved in this field. Summary of the Invention

[0004] In view of this, the purpose of this invention is to provide a method, apparatus, device, and medium for cross-network node classification based on graph contrastive learning, which can improve the stability of cross-network node classification, enhance resistance to network structural noise, and achieve matching of the category conditional distributions of the source and target networks. The specific solution is as follows:

[0005] Firstly, this application discloses a cross-network node classification method based on graph contrastive learning, applied to the MAGCL model, including:

[0006] Historical nodes of the source network and nodes to be classified in the target network are obtained respectively. Adaptive edge weights are calculated for the historical nodes of the source network and the nodes to be classified in the target network to obtain the features of the historical nodes of the source network and the features of the nodes to be classified in the target network, and the label prediction probability of the historical nodes of the source network is determined.

[0007] The true labels of the source network historical nodes are determined, and a node classification loss function is constructed based on the predicted probability of the labels and the true labels. The true domain labels of the source network historical nodes and the target network unclassified nodes are determined, and a domain classification loss function is constructed based on the true domain labels, the features of the source network historical nodes, and the features of the target network unclassified nodes.

[0008] Generate positive and negative sample pairs for the source network historical nodes and the target network nodes to be classified, and construct a specific network graph contrast loss function and a cross-network graph contrast loss function based on the positive and negative sample pairs;

[0009] An objective function is constructed based on the node classification loss function, the domain classification loss function, the specific network graph comparison loss function, and the cross-network graph comparison loss function. The objective function is then used to optimize the local learnable parameters to obtain the optimized learnable parameters.

[0010] Determine whether the objective function meets the preset convergence condition. If the objective function meets the preset convergence condition, then use the optimized learnable parameters to predict the node labels of the target network to be classified, so as to obtain the labels of each target network node to be classified, so that the target network can classify the target network node to be classified according to the labels of each target network node to be classified.

[0011] Optionally, determining the true labels of the historical nodes in the source network and constructing a node classification loss function based on the predicted probabilities of the labels and the true labels includes:

[0012] The true labels of the historical nodes of the source network are determined, and a node classifier is constructed for the features of the historical nodes of the source network.

[0013] The node classifier is used to determine the predicted label probability of the historical nodes in the source network, and a node classification loss function is constructed based on the predicted label probability and the real label.

[0014] Optionally, determining the true domain labels of the source network historical nodes and the target network nodes to be classified, and constructing a domain classification loss function based on the true domain labels, the features of the source network historical nodes, and the features of the target network nodes to be classified, includes:

[0015] The true domain labels of the source network historical nodes and the target network nodes to be classified are determined, and a multilayer perceptron is used to construct a domain discriminator for the target network nodes to be classified.

[0016] Based on the historical node features of the source network and the node features to be classified in the target network, and using the domain discriminator, the predicted domain probability of the historical node of the source network and the predicted domain probability of the node to be classified in the target network are determined respectively.

[0017] A domain classification loss function is constructed based on the predicted domain probabilities of the historical nodes in the source network, the predicted domain probabilities of the nodes to be classified in the target network, and the real domain labels.

[0018] Optionally, the step of generating positive and negative sample pairs for the source network historical nodes and the target network nodes to be classified, and constructing a specific network graph contrastive loss function and a cross-network graph contrastive loss function based on the positive and negative sample pairs, includes:

[0019] The local graph encoder generates learnable augmented views for the source network and the target network, and generates positive and negative sample pairs for the historical nodes of the source network and the nodes to be classified in the target network. The features of the historical nodes of the source network and the features of the nodes to be classified in the target network are used as inputs to the mean clustering algorithm to obtain cluster labels, and the cluster labels are used as pseudo labels for the target network.

[0020] A specific network graph contrast loss function is constructed based on the positive and negative sample pairs, and a cross-network graph contrast loss function is constructed based on the positive and negative sample pairs, the real labels, and the pseudo labels.

[0021] Optionally, before obtaining the source network historical nodes and the target network nodes to be classified, the method further includes:

[0022] A multi-layered multi-head graph attention network is used to construct the graph encoder, a single-layered multi-head graph attention network is used to construct the node classifier, and a multi-layer perceptron is used to construct the domain discriminator; wherein, the domain-adaptive graph neural network includes the graph encoder, the node classifier, and the domain discriminator.

[0023] The MAGCL model is constructed based on the graph neural network, the graph contrast learning module of the specific network, and the category-aware cross-network graph contrast learning module.

[0024] Optionally, before determining whether the objective function meets the preset convergence condition, the method further includes:

[0025] A gradient inversion layer is inserted between the local graph encoder and the domain discriminator to invert the gradient of the domain classification loss with respect to the learnable parameters of the graph encoder, so that the graph encoder and the domain discriminator can be updated during backpropagation.

[0026] Optionally, optimizing the locally learnable parameters using the objective function to obtain optimized learnable parameters includes:

[0027] The learnable parameters of the graph encoder, the learnable parameters of the node classifier, and the learnable parameters of the domain discriminator in the graph neural network are updated using the objective function to obtain the first parameter, the second parameter, and the third parameter, respectively.

[0028] The optimized parameters are obtained by selecting parameters from the first parameter, the second parameter, and the third parameter.

[0029] Secondly, this application discloses a cross-network node classification device based on graph contrastive learning, comprising:

[0030] The node feature determination module is used to acquire historical nodes of the source network and nodes to be classified in the target network, respectively, perform adaptive edge weight calculation on the historical nodes of the source network and the nodes to be classified in the target network to obtain the features of the historical nodes of the source network and the features of the nodes to be classified in the target network, and determine the label prediction probability of the historical nodes of the source network.

[0031] The classification loss function construction module is used to determine the true labels of the source network historical nodes, construct a node classification loss function based on the predicted probability of the labels and the true labels, determine the true domain labels of the source network historical nodes and the target network unclassified nodes, and construct a domain classification loss function based on the true domain labels, the features of the source network historical nodes and the features of the target network unclassified nodes.

[0032] The graph contrast loss function construction module is used to generate positive and negative sample pairs for the source network historical nodes and the target network nodes to be classified, and to construct a specific network graph contrast loss function and a cross-network graph contrast loss function based on the positive and negative sample pairs;

[0033] The objective function construction module is used to construct an objective function based on the node classification loss function, the domain classification loss function, the specific network graph comparison loss function, and the cross-network graph comparison loss function, and to optimize the local learnable parameters using the objective function to obtain optimized learnable parameters.

[0034] The node classification module is used to determine whether the objective function meets the preset convergence condition. If the objective function meets the preset convergence condition, the optimized learnable parameters are used to predict the node labels of the target network to be classified, so as to obtain the labels of each target network node to be classified, so that the target network can classify the target network node to be classified according to the labels of each target network node to be classified.

[0035] Thirdly, this application discloses an electronic device, including:

[0036] Memory, used to store computer programs;

[0037] A processor is used to execute the computer program to implement the aforementioned cross-network node classification method based on graph contrastive learning.

[0038] Fourthly, this application discloses a computer storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the steps of the aforementioned disclosed cross-network node classification method based on graph contrastive learning.

[0039] As can be seen, this application provides a cross-network node classification method based on graph contrastive learning, including obtaining source network historical nodes and target network nodes to be classified, respectively; performing adaptive edge weight calculation on the source network historical nodes and the target network nodes to be classified to obtain the features of the source network historical nodes and the target network nodes to be classified, and determining the label prediction probability of the source network historical nodes; determining the true label of the source network historical nodes; constructing a node classification loss function based on the label prediction probability and the true label; determining the true domain labels of the source network historical nodes and the target network nodes to be classified; constructing a domain classification loss function based on the true domain labels, the features of the source network historical nodes, and the features of the target network nodes to be classified; and assigning a domain classification loss function to the source network historical nodes and the target network nodes to be classified. The target network generates positive and negative sample pairs for the nodes to be classified. Based on these positive and negative sample pairs, a specific network graph contrastive loss function and a cross-network graph contrastive loss function are constructed. An objective function is constructed based on the node classification loss function, the domain classification loss function, the specific network graph contrastive loss function, and the cross-network graph contrastive loss function. The objective function is then used to optimize the local learnable parameters to obtain optimized learnable parameters. It is determined whether the objective function meets a preset convergence condition. If the objective function meets the preset convergence condition, the optimized learnable parameters are used to predict the node labels for the nodes to be classified in the target network, thereby obtaining labels for each node to be classified in the target network. The target network then classifies the nodes to be classified based on these labels. This application is applied to a novel cross-network node classification model, namely the Multi-head Attention Empowered Graph Contrastive Learning (MAGCL) model. The MAGCL model uses a graph attention network as a graph encoder, which can automatically learn adaptive edge weights, thus having stronger resistance to network structure noise. By minimizing the category-aware cross-network graph contrast loss, the graph encoder learns similar features for nodes of the same category in different networks, and different features for nodes of different categories in different networks, thereby matching the category conditional distributions of the source network and the target network. Attached Figure Description

[0040] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0041] Figure 1 This is a flowchart of a cross-network node classification method based on graph contrast learning disclosed in this application;

[0042] Figure 2 This is a detailed structural diagram of a MAGCL model disclosed in this application;

[0043] Figure 3 This is a flowchart of a cross-network node classification method based on graph contrast learning disclosed in this application;

[0044] Figure 4 This is an example diagram showing experimental results of a MAGCL model disclosed in this application;

[0045] Figure 5 This is a schematic diagram of a cross-network node classification device based on graph contrast learning disclosed in this application;

[0046] Figure 6 This application provides a structural diagram of an electronic device. Detailed Implementation

[0047] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0048] Node classification has always been a highly researched topic in graph machine learning, and has been widely applied in fields such as social networks, biomedicine, and e-commerce. Existing node classification algorithms generally focus on single-network applications, assuming that both training and test nodes are sampled from a single network. However, in practical applications, node classification can be performed across different networks, meaning that training and test nodes are sampled from networks with different data distributions. Cross-network node classification has a variety of real-world applications. For example, in the cross-network influence maximization problem, all nodes in a small source network have labels reflecting their influence, while all nodes in a large target network lack labels. To maximize the influence of the target network, we can transfer knowledge learned from the source network to the target network to help it select the most influential nodes. In the cross-domain protein function prediction problem, given a protein-protein interaction source network with abundant protein function labels and a protein-protein interaction target network lacking protein function labels, we can transfer knowledge learned from the source network to help the target network predict protein functions. In cross-domain recommendation tasks, given a source social network with rich user interest labels and a target social network lacking user interest labels, we can transfer knowledge learned from the source network to help the target network predict user interests. Existing cross-network node classification algorithms generally adopt a combination of graph neural networks and domain adaptation. On the one hand, this solves the problem that graph neural networks lack consideration of inter-domain distribution differences, and on the other hand, it solves the problem that domain adaptation algorithms lack consideration of network topology. However, existing cross-network node classification algorithms still have the following shortcomings: (1) Existing cross-network node classification algorithms generally adopt graph neural network models with fixed edge weights, which have low resistance to network structure noise. (2) Most existing cross-network node classification algorithms only focus on matching the edge distributions of the source and target networks, but cannot guarantee the matching of class conditional distributions of different networks, that is, they cannot guarantee that nodes of the same category have similar representations in different networks. In graph data analysis, labels are often expensive, limited, or even unavailable. In order to utilize a large amount of unlabeled graph data, graph contrastive learning has recently provided a promising paradigm. By combining graph neural networks with contrastive learning, graph representations can be learned unsupervised without relying on label information. While graph contrastive learning has demonstrated superior performance in unsupervised graph representation learning for single networks, its application to cross-network node classification remains unexplored. Therefore, improving the stability of cross-network node classification, enhancing its resistance to network structural noise, and achieving matching of the class conditional distributions of the source and target networks are unresolved issues in this field.

[0049] See Figure 1As shown, this embodiment of the invention discloses a cross-network node classification method based on graph contrastive learning, which may specifically include:

[0050] Step S11: Obtain the source network historical nodes and the target network unclassified nodes respectively, perform adaptive edge weight calculation on the source network historical nodes and the target network unclassified nodes respectively to obtain the features of the source network historical nodes and the features of the target network unclassified nodes, and determine the label prediction probability of the source network historical nodes.

[0051] In this embodiment, before acquiring the historical nodes of the source network and the nodes to be classified in the target network, the method further includes: constructing a graph encoder using a multi-layered multi-head graph attention network, constructing a node classifier using a single-layered multi-head graph attention network, and constructing a domain discriminator using a multi-layer perceptron; wherein, the domain-adaptive graph neural network includes a graph encoder, a node classifier, and a domain discriminator; the MAGCL model is constructed based on the graph neural network, a graph contrast learning module for a specific network, and a category-aware cross-network graph contrast learning module. This application applies to the MAGCL model, which consists of three modules: a domain-adaptive graph neural network, a graph contrast learning module for a specific network, and a category-aware cross-network graph contrast learning module, with the specific structure as follows. Figure 2 As shown, the domain-adaptive graph neural network comprises a graph encoder, a node classifier, and a domain discriminator. We choose a multi-layered multi-head graph attention network to construct the graph encoder, a single-layered multi-head graph attention network to construct the node classifier, and a multi-layer perceptron to construct the domain discriminator. To match the edge distributions of the source and target networks, an adversarial domain adaptation method based on gradient inversion layers is employed to adversarially train the graph encoder and domain discriminator. A network-specific graph contrastive learning module defines positive and negative sample pairs based on the network topology and designs a network-specific graph contrastive loss to guide the graph encoder in extracting core mutual information between different contrastive views of each network. A category-aware cross-network graph contrastive learning module defines positive and negative sample pairs between different networks based on the known labels of the source network and the pseudo-labels of the target network, and designs a category-aware graph contrastive loss to extract core mutual information between the source and target networks, thereby matching the category conditional distributions of the source and target networks.

[0052] In this embodiment, a mini-batch training strategy is adopted, randomly selecting a batch from each network. The nodes. Then, a graph attention head is used for each pair of connected nodes (v) in the batch. i ,v j The adaptive edge weights are learned as follows:

[0053]

[0054] in, and This indicates that node v in batch B i The set of all first-order neighbor nodes, This represents the k-th graph attention head pair connected to the nodes (v i ,v j The adaptive edge weights learned reflect the learning of node v. j For node v i The importance of W. h (k) It is the learnable weight matrix of the k-th graph attention head in the graph encoder. Represents the splicing operation, a h (k) It is the learnable weight vector of the k-th attention head in the graph encoder.

[0055] In batch B, based on the adaptive edge weights learned above, neighbor information is aggregated to update the node features:

[0056]

[0057] Among them, h i (k) It is node v i In a multi-head graph attention network, we use multiple attention heads to independently execute the above formula, taking into account the feature vectors of the given vectors. It's important to note that the learnable parameters of different attention heads are not shared. This is achieved by concatenating K... h The attention head learns the node features and generates the final node features:

[0058]

[0059] Among them, h i The image encoder is v i The learned final node feature vector. The above process uses only a single-layer multi-head graph attention network to aggregate information between first-order neighbors. To aggregate information from higher-order neighbors, multiple layers of multi-head graph attention networks can be stacked.

[0060] Step S12: Determine the true labels of the source network historical nodes, construct a node classification loss function based on the predicted probability of the labels and the true labels, determine the true domain labels of the source network historical nodes and the target network nodes to be classified, and construct a domain classification loss function based on the true domain labels, the features of the source network historical nodes and the features of the target network nodes to be classified.

[0061] Step S13: Generate positive and negative sample pairs for the source network historical nodes and the target network nodes to be classified, and construct a specific network graph contrast loss function and a cross-network graph contrast loss function based on the positive and negative sample pairs.

[0062] Step S14: Construct an objective function based on the node classification loss function, the domain classification loss function, the specific network graph comparison loss function, and the cross-network graph comparison loss function, and use the objective function to optimize the local learnable parameters to obtain optimized learnable parameters.

[0063] Step S15: Determine whether the objective function meets the preset convergence condition. If the objective function meets the preset convergence condition, then use the optimized learnable parameters to predict the node labels of the target network to be classified, so as to obtain the labels of each target network node to be classified, so that the target network can classify the target network node to be classified according to the labels of each target network node to be classified.

[0064] In this embodiment, if the objective function meets the preset convergence condition, the learnable parameters of the graph encoder, the learnable parameters of the node classifier, and the learnable parameters of the domain discriminator in the graph neural network are updated using the objective function to obtain the first parameter, the second parameter, and the third parameter, respectively. Then, each parameter is selected from the first parameter, the second parameter, and the third parameter to obtain the optimized parameter. Then, the optimized parameter is used to predict the node labels of the target network nodes to be classified to obtain the labels of each target network node to be classified, so that the target network can classify the target network nodes to be classified according to the labels of each target network node to be classified.

[0065] In this embodiment, source network historical nodes and target network nodes to be classified are obtained respectively. Adaptive edge weights are calculated for the source network historical nodes and the target network nodes to be classified to obtain the features of the source network historical nodes and the target network nodes to be classified, and the label prediction probability of the source network historical nodes is determined. The true labels of the source network historical nodes are determined, and a node classification loss function is constructed based on the label prediction probability and the true labels. The true domain labels of the source network historical nodes and the target network nodes to be classified are determined, and a domain classification loss function is constructed based on the true domain labels, the features of the source network historical nodes, and the features of the target network nodes to be classified. Positive domain labels are generated for the source network historical nodes and the target network nodes to be classified. Negative sample pairs are used to construct a specific network graph contrast loss function and a cross-network graph contrast loss function. An objective function is constructed based on the node classification loss function, the domain classification loss function, the specific network graph contrast loss function, and the cross-network graph contrast loss function. The objective function is then used to optimize the local learnable parameters to obtain optimized learnable parameters. It is determined whether the objective function meets a preset convergence condition. If the objective function meets the preset convergence condition, the optimized learnable parameters are used to predict the node labels of the target network nodes to be classified, thereby obtaining the labels of each target network node to be classified. This allows the target network to classify the target network nodes according to the labels of each target network node to be classified. This application is applied to a novel cross-network node classification model, namely the Multi-head Attention Empowered Graph Contrastive Learning (MAGCL) model. The MAGCL model uses a graph attention network as a graph encoder, which can automatically learn adaptive edge weights, thus having stronger resistance to network structure noise. By minimizing the category-aware cross-network graph contrastive loss, the graph encoder learns similar features for nodes of the same category in different networks, and different features for nodes of different categories in different networks, thereby matching the category conditional distributions of the source network and the target network.

[0066] See Figure 3 As shown, this embodiment of the invention discloses a cross-network node classification method based on graph contrastive learning, which may specifically include:

[0067] Step S21: Obtain the source network historical nodes and the target network unclassified nodes respectively, perform adaptive edge weight calculation on the source network historical nodes and the target network unclassified nodes respectively to obtain the features of the source network historical nodes and the features of the target network unclassified nodes, and determine the label prediction probability of the source network historical nodes.

[0068] Step S22: Determine the true labels of the source network historical nodes, construct a node classifier for the features of the source network historical nodes, then use the node classifier to determine the label prediction probability of the source network historical nodes, and construct a node classification loss function based on the label prediction probability and the true labels.

[0069] In this embodiment, a node classifier is added to the final node features learned by the graph encoder. Here, we use a single-layer multi-head graph attention network to construct the node classifier:

[0070]

[0071] in, It is node v i The output label probability vector, W y (k) K is the learnable weight matrix of the k-th attention head in the node classifier. y This represents the number of attention heads in the node classifier. σ() is an activation function; here we use the sigmoid function (the activation function of neural networks). Based on the true labels of the source network and the predicted label probabilities of the node classifier, the node classification loss function is defined as:

[0072]

[0073] here, Represents node v i The predicted probability labeled as category p. Represents node v i Regarding the true label of category p, if node v i It actually belongs to class p. otherwise, |B s | indicates the number of nodes in the mini-batch of the source network sampling.

[0074] Step S23: Determine the true domain labels of the source network historical nodes and the target network nodes to be classified. Use a multilayer perceptron to construct a domain discriminator for the target network nodes to be classified. Based on the features of the source network historical nodes and the features of the target network nodes to be classified, and using the domain discriminator, determine the predicted domain probability of the source network historical nodes and the predicted domain probability of the target network nodes to be classified, respectively. Then, construct a domain classification loss function based on the predicted domain probability of the source network historical nodes, the predicted domain probability of the target network nodes to be classified, and the true domain labels.

[0075] In this embodiment, to match the edge distributions of the source and target networks, the present invention employs an adversarial domain adaptation method based on a gradient inversion layer to counteract the training graph encoder and domain discriminator. We use a multilayer perceptron (MLP) to construct the domain discriminator. Taking node v... i The final node features are taken as input, and the domain discriminator outputs node v. i The prediction domain probability from the target network, i.e. Based on the true domain labels of nodes in the source and target networks, and the predicted domain probabilities output by the domain discriminator, the domain classification loss is defined as:

[0076]

[0077] Wherein, d i It is node v i Real domain label, if node v i ∈B t ,d i =1; if v i ∈B s ,d i =0.

[0078] Step S24: Generate learnable augmented views for the source network and the target network using the local graph encoder, and generate positive and negative sample pairs for the historical nodes of the source network and the nodes to be classified in the target network. Use the features of the historical nodes of the source network and the features of the nodes to be classified in the target network as inputs to the mean clustering algorithm to obtain cluster labels, and use the cluster labels as pseudo labels for the target network. Then, construct a specific network graph contrastive loss function based on the positive and negative sample pairs, and construct a cross-network graph contrastive loss function based on the positive and negative sample pairs, the real labels, and the pseudo labels.

[0079] In this embodiment, the graph encoder described above is used to generate multiple learnable augmented views. Given a network... make and express Two learnable augmented views. From A batch of nodes in the middle of the sampling choose Middle node v i Features As anchor points, the associated positive samples include three categories: 1) features from the same node in different views. Features of neighboring nodes from the same view Features of neighboring nodes from different views And anchor point Negative samples include two classes: 1) features from non-neighboring nodes in the same view. 2) Features of non-neighboring nodes from different views

[0080] Based on the definition of positive and negative samples in the above steps, and the anchor point The graph contrast loss of a specific network is defined as:

[0081]

[0082]

[0083]

[0084] Based on the symmetry of the two enhanced views, similarly, the selection... Middle node v i Features As an anchor point, the graph compares the loss. It can be defined according to the formula above. (Selection) and Each node in the data serves as an anchor point in batch B regarding... and The graph contrast loss for a specific network is defined as:

[0085]

[0086] When there are more than two enhanced views, select any one of them. As the anchor view, and calculate other enhanced views separately. The graph contrast loss for a specific network is as follows:

[0087]

[0088] In the MAGCL model proposed in this invention, we respectively analyze the source network... and target network By applying a graph contrast learning module specific to each network, K is generated for each network. h An enhanced view, namely

[0089]

[0090]

[0091] Calculate the graph contrast loss for each network-specific aspect of the source and target networks separately. The total graph contrast loss for each network-specific aspect is:

[0092] The category-aware cross-network graph contrastive learning module proposed in this invention needs to define positive and negative sample pairs based on the node label information of different networks. However, in cross-network node classification problems, nodes in the source network have known labels, while nodes in the target network are unlabeled. Therefore, we need to obtain pseudo-labels for the nodes in the target network. In this invention, we use the final node features learned by the graph encoder as input to the K-means clustering algorithm, and use the cluster labels output by the clustering algorithm as pseudo-labels for the nodes in the target network. In the cross-network graph contrastive learning module, the source network... and target network Viewed as two contrasting views, in the source network and target network One batch was sampled from each of the two groups, i.e. and choose Node features in As anchor points, positive samples are defined as features from nodes belonging to the same category in different networks:

[0093]

[0094]

[0095] Negative samples are defined as features from nodes belonging to different categories in different networks:

[0096] Based on the definition of positive and negative samples above, given an anchor point Its associated category-aware cross-network graph contrastive loss is defined as:

[0097]

[0098] in, Indicates anchor point The number of positive samples. The formula for minimizing the category-aware cross-network graph contrastive loss will bring positive sample pairs closer together, so that cross-network nodes with the same class label have similar features; at the same time, it will push away negative sample pairs, so that cross-network nodes with different class labels have dissimilar features, thereby matching the class conditional distributions of the source and target networks. Node features in As an anchor point, its associated category-aware cross-network graph contrastive loss The calculation can be performed similarly using the formula described above. Select the source network batch. and target network batch Using all node features as anchor points, the total category-aware cross-network graph contrastive loss can be defined as:

[0099]

[0100] Step S25: Construct an objective function based on the node classification loss function, the domain classification loss function, the specific network graph comparison loss function, and the cross-network graph comparison loss function, and use the objective function to optimize the local learnable parameters to obtain optimized learnable parameters.

[0101] In this embodiment, the merging node classification loss Formulas for domain classification loss Public and specific network graph comparison loss Formula and cross-network graph comparison loss The objective function is constructed using the formula:

[0102]

[0103] Wherein, λ, θ and μ are the weights of the domain classification loss, the network graph-specific contrastive loss, and the cross-network graph contrastive loss, respectively. h θ y and θ d These are the learnable parameters for the graph encoder, node classifier, and domain discriminator, respectively.

[0104] Step S26: Determine whether the objective function meets the preset convergence condition. If the objective function meets the preset convergence condition, then use the optimized learnable parameters to predict the node labels of the target network to be classified, so as to obtain the labels of each target network node to be classified, so that the target network can classify the target network node to be classified according to the labels of each target network node to be classified.

[0105] In this embodiment, before determining whether the objective function meets the preset convergence condition, the method further includes: inserting a gradient inversion layer between the local graph encoder and the domain discriminator, and using the gradient inversion layer to invert the gradient of the domain classification loss with respect to the learnable parameters of the graph encoder, so as to update the graph encoder and the domain discriminator during backpropagation.

[0106] The proposed MAGCL model employs an end-to-end approach to optimize the objective function. To simultaneously update the learnable parameters of both the graph encoder and the domain discriminator during each backpropagation, the MAGCL model inserts a gradient inversion layer between them to invert the gradient of the domain classification loss with respect to the learnable parameters of the graph encoder. Once the objective function reaches convergence, the learned optimal parameters θ of the graph encoder are used. h * Based on the above steps, the final node features are learned for the source network and the target network, resulting in... and

[0107] Then based on Using the optimal parameters θ of the learned node classifier y * Predict the class labels of all nodes in the target network.

[0108] The proposed MAGCL model was compared extensively with 12 state-of-the-art algorithms on six cross-network node classification tasks. Experimental results show that the MAGCL model achieves the highest node classification accuracy among the 13 algorithms tested. Specific experimental results are as follows: Figure 4 As shown in Table 1, the MAGCL algorithm proposed in this invention uses citation networks as a practical application scenario and conducts experimental verification on cross-network node classification problems. The citation network dataset used is shown in Table 1. Figure 4 As shown in Table 2, three citation network datasets, Citationv1, DBLPv7, and ACMv9, were selected, and six cross-network node classification tasks were performed: 1) Citationv1 as the source network and DBLPv7 as the target network; 2) DBLPv7 as the source network and Citationv1 as the target network; 3) Citationv1 as the source network and ACMv9 as the target network; 4) ACMv9 as the source network and Citationv1 as the target network; 5) DBLPv7 as the source network and ACMv9 as the target network; 6) ACMv9 as the source network and DBLPv7 as the target network. In the three citation networks Citationv1, DBLPv7, and ACMv9, each node represents a paper, and each edge represents the citation relationship between two papers. Each node has an attribute vector, which consists of keywords extracted from the paper titles. Each node has a category label representing the research field to which the paper belongs. In the source network, each node has a known category label representing the research field of each paper. However, in the target network, each node lacks a category label, meaning the research field of each paper is unknown. The MAGCL algorithm proposed in this invention can transfer knowledge learned from the source citation network to predict the research field to which papers in the target citation network belong.

[0109] In this embodiment, source network historical nodes and target network nodes to be classified are obtained respectively. Adaptive edge weights are calculated for the source network historical nodes and the target network nodes to be classified to obtain the features of the source network historical nodes and the target network nodes to be classified, and the label prediction probability of the source network historical nodes is determined. The true labels of the source network historical nodes are determined, and a node classification loss function is constructed based on the label prediction probability and the true labels. The true domain labels of the source network historical nodes and the target network nodes to be classified are determined, and a domain classification loss function is constructed based on the true domain labels, the features of the source network historical nodes, and the features of the target network nodes to be classified. Positive domain labels are generated for the source network historical nodes and the target network nodes to be classified. Negative sample pairs are used to construct a specific network graph contrast loss function and a cross-network graph contrast loss function. An objective function is constructed based on the node classification loss function, the domain classification loss function, the specific network graph contrast loss function, and the cross-network graph contrast loss function. The objective function is then used to optimize the local learnable parameters to obtain optimized learnable parameters. It is determined whether the objective function meets a preset convergence condition. If the objective function meets the preset convergence condition, the optimized learnable parameters are used to predict the node labels of the target network nodes to be classified, thereby obtaining the labels of each target network node to be classified. This allows the target network to classify the target network nodes according to the labels of each target network node to be classified. This application is applied to a novel cross-network node classification model, namely the Multi-head Attention Empowered Graph Contrastive Learning (MAGCL) model. The MAGCL model uses a graph attention network as a graph encoder, which can automatically learn adaptive edge weights, thus having stronger resistance to network structure noise. By minimizing the category-aware cross-network graph contrastive loss, the graph encoder learns similar features for nodes of the same category in different networks, and different features for nodes of different categories in different networks, thereby matching the category conditional distributions of the source network and the target network.

[0110] See Figure 5 As shown, this embodiment of the invention discloses a cross-network node classification device based on graph contrastive learning, which may specifically include:

[0111] The node feature determination module 11 is used to obtain the source network historical nodes and the target network unclassified nodes respectively, perform adaptive edge weight calculation on the source network historical nodes and the target network unclassified nodes respectively to obtain the source network historical node features and the target network unclassified node features, and determine the label prediction probability of the source network historical nodes.

[0112] The classification loss function construction module 12 is used to determine the true labels of the source network historical nodes, construct a node classification loss function based on the predicted probability of the labels and the true labels, determine the true domain labels of the source network historical nodes and the target network nodes to be classified, and construct a domain classification loss function based on the true domain labels, the features of the source network historical nodes and the features of the target network nodes to be classified.

[0113] The graph contrast loss function construction module 13 is used to generate positive and negative sample pairs for the source network historical nodes and the target network nodes to be classified, and to construct a specific network graph contrast loss function and a cross-network graph contrast loss function based on the positive and negative sample pairs;

[0114] The objective function construction module 14 is used to construct an objective function based on the node classification loss function, the domain classification loss function, the specific network graph comparison loss function, and the cross-network graph comparison loss function, and to optimize the local learnable parameters using the objective function to obtain optimized learnable parameters.

[0115] The node classification module 15 is used to determine whether the objective function meets the preset convergence condition. If the objective function meets the preset convergence condition, the optimized learnable parameters are used to predict the node labels of the target network to be classified, so as to obtain the labels of each target network node to be classified, so that the target network can classify the target network node to be classified according to the labels of each target network node to be classified.

[0116] In this embodiment, source network historical nodes and target network nodes to be classified are obtained respectively. Adaptive edge weights are calculated for the source network historical nodes and the target network nodes to be classified to obtain the features of the source network historical nodes and the target network nodes to be classified, and the label prediction probability of the source network historical nodes is determined. The true labels of the source network historical nodes are determined, and a node classification loss function is constructed based on the label prediction probability and the true labels. The true domain labels of the source network historical nodes and the target network nodes to be classified are determined, and a domain classification loss function is constructed based on the true domain labels, the features of the source network historical nodes, and the features of the target network nodes to be classified. Positive domain labels are generated for the source network historical nodes and the target network nodes to be classified. Negative sample pairs are used to construct a specific network graph contrast loss function and a cross-network graph contrast loss function. An objective function is constructed based on the node classification loss function, the domain classification loss function, the specific network graph contrast loss function, and the cross-network graph contrast loss function. The objective function is then used to optimize the local learnable parameters to obtain optimized learnable parameters. It is determined whether the objective function meets a preset convergence condition. If the objective function meets the preset convergence condition, the optimized learnable parameters are used to predict the node labels of the target network nodes to be classified, thereby obtaining the labels of each target network node to be classified. This allows the target network to classify the target network nodes according to the labels of each target network node to be classified. This application is applied to a novel cross-network node classification model, namely the Multi-head Attention Empowered Graph Contrastive Learning (MAGCL) model. The MAGCL model uses a graph attention network as a graph encoder, which can automatically learn adaptive edge weights, thus having stronger resistance to network structure noise. By minimizing the category-aware cross-network graph contrastive loss, the graph encoder learns similar features for nodes of the same category in different networks, and different features for nodes of different categories in different networks, thereby matching the category conditional distributions of the source network and the target network.

[0117] In some specific embodiments, the classification loss function construction module 12 may specifically include:

[0118] The true label determination module is used to determine the true labels of the historical nodes of the source network and to construct a node classifier for the features of the historical nodes of the source network.

[0119] The node classification loss function construction module is used to determine the label prediction probability of the historical nodes of the source network using the node classifier, and construct the node classification loss function based on the label prediction probability and the real label.

[0120] In some specific embodiments, the classification loss function construction module 12 may specifically include:

[0121] The real domain label determination module is used to determine the real domain labels of the source network historical nodes and the target network nodes to be classified, and to construct a domain discriminator for the target network nodes to be classified using a multilayer perceptron.

[0122] The prediction domain probability determination module is used to determine the prediction domain probability of the historical nodes of the source network and the prediction domain probability of the nodes to be classified in the target network based on the features of the historical nodes of the source network and the features of the nodes to be classified in the target network, and using the domain discriminator, respectively.

[0123] The domain classification loss function construction module is used to construct a domain classification loss function based on the predicted domain probabilities of the historical nodes of the source network, the predicted domain probabilities of the nodes to be classified in the target network, and the real domain labels.

[0124] In some specific embodiments, the graph contrast loss function construction module 13 may specifically include:

[0125] The pseudo-label determination module is used to generate learnable augmented views for the source network and the target network using a local graph encoder, and to generate positive and negative sample pairs for the historical nodes of the source network and the nodes to be classified in the target network. The features of the historical nodes of the source network and the features of the nodes to be classified in the target network are used as inputs to the mean clustering algorithm to obtain cluster labels, and the cluster labels are used as pseudo-labels for the target network.

[0126] The graph contrast loss function construction module is used to construct a specific network graph contrast loss function based on the positive and negative sample pairs, and to construct a cross-network graph contrast loss function based on the positive and negative sample pairs, the real labels, and the pseudo labels.

[0127] In some specific embodiments, the node feature determination module 11 may specifically include:

[0128] The graph neural network construction module is used to construct a graph encoder using a multi-layer multi-head graph attention network, a node classifier using a single-layer multi-head graph attention network, and a domain discriminator using a multi-layer perceptron; wherein, the domain-adaptive graph neural network includes a graph encoder, a node classifier, and a domain discriminator.

[0129] The MAGCL model building module is used to build the MAGCL model based on the graph neural network, the graph contrast learning module of a specific network, and the category-aware cross-network graph contrast learning module.

[0130] In some specific embodiments, the objective function construction module 14 may specifically include:

[0131] An update module is used to insert a gradient inversion layer between the local graph encoder and the domain discriminator, using the gradient inversion layer to invert the gradient of the domain classification loss with respect to the learnable parameters of the graph encoder, so as to update the graph encoder and the domain discriminator during backpropagation.

[0132] In some specific embodiments, the node classification module 15 may specifically include:

[0133] The parameter determination module is used to update the learnable parameters of the graph encoder, the learnable parameters of the node classifier, and the learnable parameters of the domain discriminator in the graph neural network using the objective function, so as to obtain the first parameter, the second parameter, and the third parameter.

[0134] The optimization parameter determination module is used to select parameters from the first parameter, the second parameter, and the third parameter to obtain the optimization parameters.

[0135] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the graph contrast learning-based cross-network node classification method disclosed in any of the foregoing embodiments.

[0136] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0137] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored on it include operating system 221, computer program 222 and data 223, etc., and the storage method can be temporary storage or permanent storage.

[0138] The operating system 221 manages and controls the various hardware devices on the electronic device 20 and the computer program 222 to enable the processor 21 to perform operations and processing on the data 223 in the memory 22. The operating system 221 can be Windows, Unix, Linux, etc. The computer program 222, in addition to including a computer program capable of performing the graph contrast learning-based cross-network node classification method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, may further include computer programs capable of performing other specific tasks. The data 223 may include data received by the graph contrast learning-based cross-network node classification device from external devices, as well as data collected by its own input / output interface 25.

[0139] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0140] Furthermore, embodiments of this application also disclose a computer-readable storage medium storing a computer program. When the computer program is loaded and executed by a processor, it implements the steps of the cross-network node classification method based on graph contrast learning disclosed in any of the foregoing embodiments.

[0141] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0142] The foregoing has provided a detailed description of a cross-network node classification method, apparatus, device, and storage medium based on graph contrastive learning provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A cross-network node classification method based on graph contrastive learning, characterized in that, MAGCL, a graph contrastive learning model applied to multi-head attention, includes: Historical nodes of the source network and nodes to be classified in the target network are obtained respectively. Adaptive edge weights are calculated for the historical nodes of the source network and the nodes to be classified in the target network to obtain the features of the historical nodes of the source network and the features of the nodes to be classified in the target network, and the label prediction probability of the historical nodes of the source network is determined. The true labels of the source network historical nodes are determined, and a node classification loss function is constructed based on the predicted probability of the labels and the true labels. The true domain labels of the source network historical nodes and the target network unclassified nodes are determined, and a domain classification loss function is constructed based on the true domain labels, the features of the source network historical nodes, and the features of the target network unclassified nodes. Generate positive and negative sample pairs for the source network historical nodes and the target network nodes to be classified, and construct a specific network graph contrast loss function and a cross-network graph contrast loss function based on the positive and negative sample pairs; An objective function is constructed based on the node classification loss function, the domain classification loss function, the specific network graph comparison loss function, and the cross-network graph comparison loss function. The objective function is then used to optimize the local learnable parameters to obtain the optimized learnable parameters. Determine whether the objective function meets the preset convergence condition. If the objective function meets the preset convergence condition, then use the optimized learnable parameters to predict the node labels of the target network to be classified, so as to obtain the labels of each target network node to be classified, so that the target network can classify the target network node to be classified according to the labels of each target network node to be classified.

2. The cross-network node classification method based on graph contrastive learning according to claim 1, characterized in that, The process of determining the true labels of the historical nodes in the source network, and constructing a node classification loss function based on the predicted probabilities of the labels and the true labels, includes: The true labels of the historical nodes of the source network are determined, and a node classifier is constructed for the features of the historical nodes of the source network. The node classifier is used to determine the predicted label probability of the historical nodes in the source network, and a node classification loss function is constructed based on the predicted label probability and the real label.

3. The cross-network node classification method based on graph contrastive learning according to claim 1, characterized in that, The process involves determining the true domain labels of the source network historical nodes and the target network nodes to be classified, and constructing a domain classification loss function based on the true domain labels, the features of the source network historical nodes, and the features of the target network nodes to be classified, including: The true domain labels of the source network historical nodes and the target network nodes to be classified are determined, and a multilayer perceptron is used to construct a domain discriminator for the target network nodes to be classified. Based on the historical node features of the source network and the node features to be classified in the target network, and using the domain discriminator, the predicted domain probability of the historical node of the source network and the predicted domain probability of the node to be classified in the target network are determined respectively. A domain classification loss function is constructed based on the predicted domain probabilities of the historical nodes in the source network, the predicted domain probabilities of the nodes to be classified in the target network, and the real domain labels.

4. The cross-network node classification method based on graph contrastive learning according to claim 1, characterized in that, The process involves generating positive and negative sample pairs for the source network historical nodes and the target network nodes to be classified, and constructing a specific network graph contrastive loss function and a cross-network graph contrastive loss function based on the positive and negative sample pairs, including: The local graph encoder generates learnable augmented views for the source network and the target network, and generates positive and negative sample pairs for the historical nodes of the source network and the nodes to be classified in the target network. The features of the historical nodes of the source network and the features of the nodes to be classified in the target network are used as inputs to the mean clustering algorithm to obtain cluster labels, and the cluster labels are used as pseudo labels for the target network. A specific network graph contrast loss function is constructed based on the positive and negative sample pairs, and a cross-network graph contrast loss function is constructed based on the positive and negative sample pairs, the real labels, and the pseudo labels.

5. The cross-network node classification method based on graph contrastive learning according to any one of claims 1 to 4, characterized in that, Before obtaining the source network historical nodes and the target network nodes to be classified, respectively, the process also includes: A multi-layered multi-head graph attention network is used to construct the graph encoder, a single-layered multi-head graph attention network is used to construct the node classifier, and a multi-layer perceptron is used to construct the domain discriminator; wherein, the domain-adaptive graph neural network includes the graph encoder, the node classifier, and the domain discriminator. The MAGCL model is constructed based on the graph neural network, the graph contrast learning module of the specific network, and the category-aware cross-network graph contrast learning module.

6. The cross-network node classification method based on graph contrastive learning according to claim 5, characterized in that, Before determining whether the objective function meets the preset convergence condition, the method further includes: A gradient inversion layer is inserted between the local graph encoder and the domain discriminator to invert the gradient of the domain classification loss with respect to the learnable parameters of the graph encoder, so that the graph encoder and the domain discriminator can be updated during backpropagation.

7. The cross-network node classification method based on graph contrastive learning according to claim 5, characterized in that, The optimization of the local learnable parameters using the objective function to obtain optimized learnable parameters includes: The learnable parameters of the graph encoder, the learnable parameters of the node classifier, and the learnable parameters of the domain discriminator in the graph neural network are updated using the objective function to obtain the first parameter, the second parameter, and the third parameter, respectively. The optimized parameters are obtained by selecting parameters from the first parameter, the second parameter, and the third parameter.

8. A cross-network node classification device based on graph contrastive learning, characterized in that, include: The node feature determination module is used to acquire historical nodes of the source network and nodes to be classified in the target network, respectively, perform adaptive edge weight calculation on the historical nodes of the source network and the nodes to be classified in the target network to obtain the features of the historical nodes of the source network and the features of the nodes to be classified in the target network, and determine the label prediction probability of the historical nodes of the source network. The classification loss function construction module is used to determine the true labels of the source network historical nodes, construct a node classification loss function based on the predicted probability of the labels and the true labels, determine the true domain labels of the source network historical nodes and the target network unclassified nodes, and construct a domain classification loss function based on the true domain labels, the features of the source network historical nodes and the features of the target network unclassified nodes. The graph contrast loss function construction module is used to generate positive and negative sample pairs for the source network historical nodes and the target network nodes to be classified, and to construct a specific network graph contrast loss function and a cross-network graph contrast loss function based on the positive and negative sample pairs; The objective function construction module is used to construct an objective function based on the node classification loss function, the domain classification loss function, the specific network graph comparison loss function, and the cross-network graph comparison loss function, and to optimize the local learnable parameters using the objective function to obtain optimized learnable parameters. The node classification module is used to determine whether the objective function meets the preset convergence condition. If the objective function meets the preset convergence condition, the optimized learnable parameters are used to predict the node labels of the target network to be classified, so as to obtain the labels of each target network node to be classified, so that the target network can classify the target network node to be classified according to the labels of each target network node to be classified.

9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the cross-network node classification method based on graph contrastive learning as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, Used to store computer programs; wherein, when the computer programs are executed by a processor, they implement the cross-network node classification method based on graph contrastive learning as described in any one of claims 1 to 7.