Robust Heterogeneous Graph Contrastive Learning Method Based on Intrinsic Pattern Preserving View Generation

By constructing an intrinsic pattern preserving view, generating a robust intrinsic pattern view by fusing feature induced graph and adjacency matrix, optimizing sample selection and contrast loss, the robustness problem of heterogeneous graph contrastive learning method under graph structure noise is solved, and the accuracy and stability of node classification are improved.

CN119293479BActive Publication Date: 2025-09-26TONGJI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411364531.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2025-09-26
Estimated Expiration
2044-09-29

AI Technical Summary

Technical Problem

Existing heterogeneous graph contrastive learning methods are not robust enough in the face of graph structural noise and are easily affected by noise, resulting in node representations reflecting incorrect relationships and incorrect selection of positive and negative samples, which affects the classification effect.

Method used

By constructing intrinsic pattern-preserving views, a robust intrinsic pattern view is generated by fusion of feature-induced graph and adjacency matrix. Feature similarity and potential interaction differences are combined to adaptively fuse node features, optimize sample selection and contrast loss, and introduce a view regularizer to enhance model robustness.

Benefits of technology

It effectively improves the robustness of heterogeneous graph contrast learning methods under graph structure noise, reduces the possibility of erroneous samples, and improves the accuracy and stability of node classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119293479B_ABST
    Figure CN119293479B_ABST
Patent Text Reader

Abstract

The present invention relates to a robust contrastive learning method for heterogeneous graphs based on intrinsic pattern-preserving view generation. The method comprises: obtaining a set of transformed features; obtaining an intrinsic pattern view; extracting node embeddings from the intrinsic pattern view and the original view; obtaining a set of positive and negative samples; optimizing a contrastive learning model; and judging the optimized contrastive model. If converged, the node embeddings of the original view obtained using the optimized contrastive model are used to output a prediction of the target node's category. Compared with existing techniques, this method effectively improves the robustness of heterogeneous graphs to structural noise and enhances classification accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of heterogeneous graph neural networks and graph contrastive learning, and in particular to a robust heterogeneous graph contrastive learning method based on intrinsic pattern-preserving view generation. Background Art

[0002] In academia, effective classification of entities such as paper topics, author research areas, and conference types is crucial for facilitating the retrieval of research findings, analyzing academic impact, and managing academic resources. To this end, attempts have been made to use heterogeneous graphs to model the diverse entities involved in academic research (e.g., papers, authors, conferences) and their complex relationships. Heterogeneous graph neural networks (HGNNs) are then used to learn representation vectors for each entity, thereby achieving effective classification. However, labeled data is often scarce in practical applications, making HGNNs trained using a (semi-)supervised learning paradigm that relies on a large number of labels ineffective. This has inspired various self-supervised learning methods for heterogeneous graph embedding to address the label scarcity issue, among which contrastive learning has recently received significant attention. It aims to learn node representations by maximizing the similarity between related pairs (positive samples) and minimizing the similarity between unrelated pairs (negative samples). Some work has used contrastive learning to pre-train HGNNs and fine-tune them using a small amount of labeled data, achieving good classification results. However, existing heterogeneous graph contrastive learning (HGCL) methods typically assume that the original HG structure is reliable. As a result, their network performance degrades significantly when the HG structure is affected by noise, such as adversarial attacks or missing edges. This susceptibility to graph structural noise is due to two reasons: first, the original HG generates different views of various granularities without adapting to graph noise, resulting in node representations reflecting incorrect relationships; second, positive and negative samples are selected based on the graph structure in the generated views, increasing the likelihood of erroneous samples and forcing different nodes closer together, making HGCL sensitive to noisy original graphs. Summary of the Invention

[0003] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide a robust heterogeneous graph contrast learning method based on intrinsic pattern preserving view generation.

[0004] The purpose of the present invention can be achieved by the following technical solutions:

[0005] According to a first aspect of the present invention, a robust heterogeneous graph contrastive learning method based on intrinsic pattern-preserving view generation is provided, the method comprising:

[0006] Constructing an original view based on input data, projecting heterogeneous node features located in different dimensional subspaces into a d-dimensional common space to obtain a transformed feature set; the input data includes a set of features classified as papers, authors, and conferences; the heterogeneous node features include text content, publication time, field, citations, and conference name;

[0007] Constructing a relational subgraph based on the relationship of the input data and obtaining a corresponding adjacency matrix; constructing a feature-induced graph; and obtaining an intrinsic pattern view based on the adjacency matrix and the feature-induced graph;

[0008] Extract node embeddings of intrinsic pattern views and original views using heterogeneous graph neural networks based on intrinsic pattern views, original views, and transformed feature sets;

[0009] Calculating the metapath graphs of the original view and the intrinsic pattern view respectively, obtaining a sample set based on the metapath graph of the original view, and processing the sample set to obtain an initial sample set; obtaining a sample set to be merged based on the metapath graph of the intrinsic pattern view; fusing the sample set to be merged with the initial sample set according to a merging rule to obtain a positive sample set, and the remaining nodes in the sample set are negative sample sets;

[0010] Projecting the node embeddings of the intrinsic pattern view and the original view into the same space to obtain a projected embedding, and calculating the contrast loss in combination with the positive sample set and the negative sample set; constructing a view regularizer and optimizing the contrastive learning model in combination with the contrast loss;

[0011] The optimized contrast model is judged. If converged, the node embedding of the original view obtained by the optimized contrast model is used to output the prediction result of the category to which the target node belongs; the category is a semantic category.

[0012] As a preferred technical solution, the method for obtaining the conversion feature set includes:

[0013] Projecting the heterogeneous node features into a d-dimensional common space through a layer of perceptrons to obtain node conversion features;

[0014] Get the node conversion features of all nodes of the same type to obtain a conversion feature set.

[0015] As a preferred technical solution, the feature induced graph includes a feature induced graph of an adjacency matrix, a head node feature induced graph, and a tail node feature induced graph;

[0016] The method for obtaining the feature induced graph is: using a multi-head weighted cosine similarity function to calculate the feature similarity between node i and node j, the expression is:

[0017]

[0018] in, represents the Hadamard product; M is the number of heads; is the weight vector of the mth head-to-tail node connection relationship r; is the feature similarity between node i and node j;

[0019] The feature similarity is used as the edge weight, and a feature induced graph is constructed based on the edge weight.

[0020] As a preferred technical solution, the method for obtaining the intrinsic mode view is:

[0021] The feature-induced graphs of the head node and the tail node are fused with the adjacency matrix respectively, and the expression is:

[0022]

[0023] in, is the first feature similarity; is the second feature similarity, A r is the adjacency matrix with the head and tail node connection relationship r; I is the identity matrix; is the feature induced graph of the head node; is the tail node feature induction graph; φ + (r) and φ - (r) are mapping functions that map relation r to the types of its head node and tail node respectively;

[0024] The mask matrix is ​​used to remove edges with weights less than the threshold to obtain the first candidate graph and the second candidate graph. The expression is:

[0025]

[0026] in, is the first candidate graph; is the second candidate graph; M r is the mask matrix; represents Hadamard product; ∈ represents threshold;

[0027] The third candidate graph is obtained by filtering the adjacency matrix based on the same mask matrix. The expression is: in is the third candidate map;

[0028] Use single-layer channel attention to fuse the feature-induced graph of the first candidate graph, the second candidate graph, the third candidate graph, and the adjacency matrix to obtain a dense adjacency matrix;

[0029] The dense adjacency matrix is ​​subjected to a specific type of sparseness to obtain the final adjacency matrix A′ r, construct the intrinsic pattern view of the corresponding subgraph according to the final adjacency matrix;

[0030] The intrinsic mode view of each relation subgraph is obtained and integrated to obtain the intrinsic mode view of the original view.

[0031] As a preferred technical solution, the specific type of sparsification refers to k-nearest neighbor sparsification, which is expressed as:

[0032]

[0033] in, Represents a dense adjacency matrix row vector Front K φ-(r) Maximum values.

[0034] As a preferred technical solution, the method for extracting node embeddings of the intrinsic pattern view and the original view is the same, specifically comprising the following steps:

[0035] The original view and intrinsic pattern view are respectively encoded with the transformed feature set, and the obtained initial values ​​are used as the input of the l-layer heterogeneous graph neural network;

[0036] In each layer of the heterogeneous graph neural network, the intermediate node embedding output by the previous layer is used as the input value of the current layer, node-level aggregation is performed first and then type-level aggregation is performed, and the intermediate node embedding after type-level aggregation is output;

[0037] The output of the lth layer is taken as the final result to get the node embedding.

[0038] As a preferred technical solution, the expression of node-level aggregation is:

[0039]

[0040] in, Indicates node level output; t indicates node type; t p represents the neighbor node type of type t node and p∈[1,J]; J represents the set of neighbor node types of type t node; r p Represents the connection relationship between neighbor node p and node t; The diagonal elements are degree matrix of ; is the element of m rows and m columns of the degree matrix; Represents the elements of the adjacency matrix m rows and n columns; is the trainable weight of layer l; He is the node type t in the lth hidden layer p Embedded and

[0041] Get the embedding of each type of neighbor node in turn

[0042] The type-level aggregate expression is:

[0043]

[0044] in, Embedding for the intermediate nodes in layer l+1; is the normalized weight of each type of neighbor, which is expressed as:

[0045] Represents the attention vector; 1 represents the all-1 vector; Represents a set of nodes of type t; Indicates the weight value of the neighbor node of type t is p; Indicates the weight value of the neighbor node j of type t.

[0046] As a preferred technical solution, the method for obtaining the positive sample specifically includes the following steps:

[0047] Calculate the meta-path graph of the original view, obtain the original view matrix based on the meta-path graph, and select the i-th row element corresponding to node i in the original view matrix;

[0048] Select the nodes corresponding to the first preset maximum values ​​in the elements of the i-th row as the initialization sample set;

[0049] Calculating a meta-path graph of the intrinsic mode view, obtaining an initial intrinsic mode view matrix based on the meta-path graph, and selecting nodes corresponding to a second preset number of maximum values ​​in the current initial intrinsic mode view matrix as a set of samples to be merged; the set of samples to be merged is at least one;

[0050] The sample set to be merged is merged with the initialization sample set according to the merging rule to obtain positive samples.

[0051] As a preferred technical solution, the merging rule is: every third preset number of initialization sample set elements are merged into a sample set to be merged.

[0052] As a preferred technical solution, the specific steps of optimizing the contrastive learning model are:

[0053] The node embedding is projected into the same space through two layers of perceptrons to obtain the projected embedding, which is expressed as:

[0054]

[0055] in, Node embedding representing the original view; Node embedding representing the intrinsic pattern view; Z O represents the projected embedding of the original view; Z IP Represents the projected embedding of the intrinsic pattern view;

[0056] Based on the projection embedding, the positive and negative samples are used to calculate the view contrast loss of the corresponding nodes in the intrinsic pattern view and the original view, which is expressed as: in, represents the intrinsic pattern view contrast loss; represents the original view contrast loss; P i represents the positive sample set; j represents the node in the positive sample; N i represents the sum of the positive and negative sample sets; sim(·) represents the cosine similarity function; δ is the temperature coefficient; k represents the node in the union of the positive and negative samples;

[0057] The contrast loss is calculated using the intrinsic pattern view contrast loss and the original view contrast loss, and the expression is:

[0058]

[0059] in, represents a node set; λ represents a hyperparameter for measuring the loss of different views;

[0060] The view regularizer is constructed using cross entropy, and its expression is:

[0061]

[0062] Among them, G O represents the original view; G IP Represents the intrinsic mode view; represents the cross entropy, and Respectively represent node i in G O and G IP Degree in; vol(G O ) and vol(G IP ) represent G o and G IP volume;

[0063] Combining contrastive loss and view regularizer to update the objective function of robust heterogeneous graph contrastive learning based on intrinsic pattern-preserving view generation is: L = L cl +γL reg , and γ is a trade-off parameter that controls the contribution of the regularizer.

[0064] Compared with the prior art, the present invention has the following advantages:

[0065] 1) The present invention constructs feature-induced graphs for all node types and relationships and adaptively fuses them with the original graph to extract intrinsic pattern views with complete semantic context to eliminate noisy edges and fill in missing edges. The intrinsic pattern views are used to improve positive sample selection, effectively improving the robustness of heterogeneous graphs to graph structural noise and reducing the possibility of false samples.

[0066] 2) The present invention uses node features as auxiliary information, introducing perturbations caused by feature similarity and distribution differences between potential interactions, thereby enhancing cross-view diversity while reducing the original graph noise, generating noise-invariant nodes, and improving classification accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] Figure 1 Schematic diagram of the process of the present invention;

[0068] Figure 2 Schematic diagram of the structure of the comparative learning model of the present invention;

[0069] Figure 3 Schematic diagram of the feature-structure fusion of the present invention to reduce the structural noise of the original image. DETAILED DESCRIPTION

[0070] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0071] Unless otherwise defined, the technical or scientific terms used in this application should have the ordinary meaning understood by a person of ordinary skill in the technical field to which this application belongs. The words "one", "a", "the" and the like used in this application do not indicate a limit on quantity and may indicate the singular or plural. The terms "include", "comprise", "have" and any variations thereof used in this application are intended to cover non-exclusive inclusions; for example, a process, method, system, product or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units that are not listed, or may also include other steps or units that are inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like used in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The word "multiple" used in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships can exist. For example, "A and / or B" can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects before and after are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific order for the objects.

[0072] According to existing technologies, it is crucial to generate views that reflect potential relationships. It is necessary to design an enhancement strategy that can retain the intrinsic patterns that reflect the underlying heterogeneous relationships, and at the same time refine sample selection based on the intrinsic patterns to reduce the incidence of erroneous samples and improve the model's robustness to graph structural noise in unsupervised scenarios, thereby improving the accuracy of node classification.

[0073] Therefore, the present invention provides a robust heterogeneous graph contrastive learning method based on intrinsic pattern preserving view generation, called VIP-HCL. Specifically, a feature induced graph is constructed through metric learning, which introduces perturbations caused by the distribution differences between feature similarities and potential interactions, thereby enhancing cross-view diversity. By propagating feature similarities on the original structure, the feature induced graph is fused with the original noise graph to eliminate noisy edges while completing the missing edges. The above two graphs are fused with the original graph to capture intrinsic patterns and then sparsified to produce the final intrinsic pattern view. In order to avoid generating erroneous samples from the noise map, we further propose a sample expansion strategy to identify potential positive samples from the intrinsic pattern view during training. The refined samples are then used to calculate the contrast loss, thereby achieving iterative optimization of the sample set and view generator. In addition, a view regularizer is introduced to maintain the discriminability of the cross-view structure and prevent the encoder from capturing irrelevant information.

[0074] Example 1:

[0075] This embodiment provides a robust heterogeneous graph contrast learning method based on intrinsic pattern preservation view generation. The flowchart of the method is as follows: Figure 1 As shown in the figure, the structure of the contrastive learning model is as follows Figure 3 As shown, the specific steps include:

[0076] S1. Get the conversion feature set:

[0077] S11. Obtain input data and construct an original view based on the input data, where the input data includes a set of features classified as papers, authors, and conferences;

[0078] S12, the heterogeneous node feature x′ i The node conversion features are obtained by projecting them into the d-dimensional public space through a layer of perceptron. The heterogeneous node features include paper features, author features, and conference features. The conversion expression is as follows:

[0079] x′ i =ELU(W φ(i) ·x i +b φ(i) ),

[0080] Where W and b are both trainable weights; φ(i) represents node i of type φ;

[0081] S13. Obtain node conversion features of all nodes of the same type to obtain a conversion feature set X′.

[0082] S2. Get the intrinsic mode view:

[0083] S21. Split the original view into relational subgraphs based on relationships, where the relationships include whether the paper was written by the author, the paper was published at a conference, and the author attended a conference on a certain topic; and obtain the adjacency matrix of the relational subgraphs;

[0084] S22, constructing a feature induced graph of the adjacency matrix, a head node feature induced graph, and a tail node feature induced graph;

[0085] S221. Construct a feature-induced graph of the adjacency matrix: Based on the homogeneity assumption of the graph, similar nodes are more likely to interact. Therefore, feature similarity is used to recover the potential interactions in the graph construction. Specifically, for nodes i and j, the multi-head weighted cosine similarity function is used to calculate the feature similarity between i and j. The expression is:

[0086]

[0087] in, represents the Hadamard product; M is the number of heads; is the weight vector of the mth head-to-tail node connection relationship r; is the feature similarity between node i and node j; the feature similarity is used as the edge weight, and a feature induced graph is constructed based on the edge weight;

[0088] S222, repeat the construction process of step S221 to respectively construct the head node feature induction graph and the tail node feature induction graph;

[0089] Due to the difference in distribution between feature similarity and true interactions, the generated feature-induced graph introduces feature-based perturbations, and feature similarity contains additional potential interactions beyond the original graph, which is beneficial to the reconstruction of intrinsic patterns;

[0090] S23. Obtaining intrinsic pattern view based on feature induced graph:

[0091] like Figure 2 The adjacency matrix A is shown r In the noise, P0 and P1 with different labels are connected to the same author node A0, so P0 and P1 may be incorrectly connected under the meta-path PAP and the edge connecting P3 and A0 is lost, resulting in the loss of semantic information between P1, P2 and P3 with the same label; reflects the potential interactions between paper nodes, so it is necessary to use To correct A r The specific process is as follows:

[0092] S231. Fuse the feature induced graph of the head node and the tail node with the adjacency matrix respectively. The expression is:

[0093]

[0094] in, is the first feature similarity; is the second feature similarity, A r is the adjacency matrix with the head and tail node connection relationship r; I is the identity matrix; is the feature induced graph of the head node; is the tail node feature induction graph; φ + (r) and φ - (r) are mapping functions that map relation r to the types of its head node and tail node respectively;

[0095] S232: Use the mask matrix to remove edges with weights less than a threshold to obtain the first candidate graph and the second candidate graph. The expression is:

[0096]

[0097] in, is the first candidate graph; is the second candidate graph; M r is the mask matrix; represents Hadamard product; ∈ represents threshold;

[0098] S233. Filter the adjacency matrix based on the same mask matrix to obtain a third candidate graph, which is expressed as: in is the third candidate map;

[0099] S234. Use a single-layer channel attention to fuse the feature-induced graph of the first candidate graph, the second candidate graph, the third candidate graph, and the adjacency matrix to obtain a dense adjacency matrix, which is expressed as follows:

[0100]

[0101] in, represents a dense adjacency matrix; Ψ r represents the channel attention layer;

[0102] S235, performing a specific type of sparseness on the dense adjacency matrix to obtain a final adjacency relationship matrix A′ r , used to improve calculation efficiency, its expression is as follows:

[0103]

[0104] in, Represents a dense adjacency matrix row vector Front K φ-(r) Maximum values;

[0105] Constructing an intrinsic pattern view of the corresponding subgraph based on the final adjacency matrix, which attenuates the input graph noise and completes the missing edges to preserve the intrinsic pattern;

[0106] S236: Obtain the intrinsic pattern view of each relationship subgraph, and integrate them to obtain the intrinsic pattern view of the original view.

[0107] S3. Design a heterogeneous graph encoder to obtain node embeddings of intrinsic pattern views and original views:

[0108] Design an HGNN-based encoder f(·) to extract node embeddings from contrasting views, i.e., based on G o The original view and G-based IP Intrinsic pattern view, due to the heterogeneity of the graph, that is, each node may contain multiple types of neighbors, so we first perform node-level aggregation to aggregate messages from each neighbor type, and then perform type-level aggregation to fuse messages from multiple neighbor types. The detailed steps are as follows:

[0109] S31. Encode the original view and the intrinsic pattern view with the transformed feature set respectively, and use the obtained initial value as the input of the l-layer heterogeneous graph neural network. The expression is as follows:

[0110]

[0111] in, Represents the input of the original view layer 0 heterogeneous graph neural network; Represents the input of the intrinsic pattern view layer 0 heterogeneous graph neural network;

[0112] S32. In each layer of the heterogeneous graph neural network, the intermediate node embedding output by the previous layer is used as the input value of the current layer. In each layer of the network, node-level aggregation is first performed and then type-level aggregation is performed. The type-level output value and the corresponding view are encoded to output the intermediate node embedding;

[0113] The expression for node-level aggregation is:

[0114]

[0115] in, Indicates node level output; t indicates node type; t p represents the neighbor node type of type t node and p∈[1,J]; J represents the set of neighbor node types of type t node; r p Represents the connection relationship between neighbor node p and node t; The diagonal elements are degree matrix of ; is the element of m rows and m columns of the degree matrix; Represents the elements of the adjacency matrix m rows and n columns; is the trainable weight of layer l; He is the node type t in the lth hidden layer p Embedded and

[0116] Get the embedding of each type of neighbor node in turn

[0117] The type-level aggregate expressions are:

[0118]

[0119] in, Embedding for the intermediate nodes in layer l+1; is the normalized weight of each type of neighbor, which is expressed as:

[0120] Represents the attention vector; 1 represents the all-1 vector; Represents a set of nodes of type t; Indicates the weight value of the neighbor node of type t is p; Indicates the weight value of the neighbor node j of type t;

[0121] S33. Take the output of the lth layer as the final result to obtain node embedding.

[0122] S4. Obtain positive and negative sample sets:

[0123] S41. Calculate the meta-path graph of the original view and obtain the original view matrix C based on the meta-path graph, where the (i, j)th element records the number of meta-paths connecting nodes i and j. For each node i, select the i-th row element C corresponding to node i in the original view matrix. [i] As a sample set, the first k ini The nodes corresponding to the maximum value are taken as the initial sample set, denoted as Used to initialize the positive sample set P i ;

[0124] S42, calculate the meta-path graph of the intrinsic mode view, obtain the initial intrinsic mode view matrix according to the meta-path graph, select the first k in the current initial intrinsic mode view matrix ext The node corresponding to the maximum value is the sample set to be merged, where k ext The value is small, usually 1 or 2, to avoid introducing false samples by feature-based perturbations in the intrinsic pattern view;

[0125] S43. Every c elements of the initialization sample set are merged into a sample set to be merged, and all the sample sets to be merged are fused with the initial sample set to obtain a positive sample set. The remaining nodes in the sample set are negative sample sets.

[0126] Generated G IP The weights of the real edges missing from the original graph are increased so that they can be IP Potential samples are identified in , which guide the view generator. In this way, the positive sampled pairs and the view generator reinforce each other, resulting in improved node representations.

[0127] S5. Optimize the contrastive learning model:

[0128] S51. Project the node embedding to the same space through two layers of perceptrons to obtain a projected embedding, the formula is:

[0129]

[0130] in, Node embedding representing the original view; Node embedding representing the intrinsic pattern view; ZO represents the projected embedding of the original view; Z IP Represents the projected embedding of the intrinsic pattern view;

[0131] S52. Based on the projection embedding, the positive samples and negative samples are used to calculate the view contrast loss of the corresponding nodes in the intrinsic pattern view and the original view, which is expressed as: in, represents the intrinsic pattern view contrast loss; represents the original view contrast loss; P i represents the positive sample set; j represents the node in the positive sample; N i represents the sum of the positive and negative sample sets; sim(·) represents the cosine similarity function; δ is the temperature coefficient; k represents the node in the union of the positive and negative samples;

[0132] S53. Calculate the contrast loss using the intrinsic pattern view contrast loss and the original view contrast loss. The expression is:

[0133]

[0134] in, represents a node set; λ represents a hyperparameter for measuring the loss of different views;

[0135] S54. Use cross entropy to construct a view regularizer, which is expressed as:

[0136]

[0137] Among them, G O represents the original view; G IP Represents the intrinsic mode view; represents the cross entropy, and Respectively represent node i in G O and G IP Degree in; vol(G O ) and vol(G IP ) represent G O and G IP volume;

[0138] S55. Combining contrastive loss and view regularizer to update the objective function of robust heterogeneous graph contrastive learning based on intrinsic pattern preservation view generation is: L = L cl +γL reg , and γ is a trade-off parameter that controls the contribution of the regularizer.

[0139] S6. Output prediction results:

[0140] The optimized comparison model is judged. If converged, the node embedding of the original view obtained by the optimized comparison model is used to output the prediction result of the category of the target node; the categories include semantic categories. Taking the paper node as an example, the categories include database field, operating system and machine learning; taking the author node as an example, the categories include database, data mining, machine learning and information retrieval; taking the conference as an example, the categories include conference field and database.

[0141] Example 2:

[0142] This example verifies that the VIP-HCL model provided by the present invention has good performance, and two academic graph datasets ACM and DBLP are selected to perform the node classification task; for each dataset, 20, 40, and 60 labeled nodes are randomly selected from each category as the training set according to HeCo, and 1000 nodes are randomly selected as the validation set and 1000 nodes as the validation set and test set.

[0143] Common multivariate classification evaluation metrics, including Macro-f1, Micro-f1, and AUC, were used. To further highlight the model's effectiveness, nine benchmark methods were selected for comparison. The experimental data is presented in Tables 1 and 2. The best-performing model data is bolded, and the second-best results are underlined. The experimental results in the tables show that the VIP-HCL model provided by the present invention outperformed other models on most training sets, demonstrating the excellent performance of the model provided by the present invention.

[0144] Table 1 Experimental results 1

[0145]

[0146] Table 2 Experimental results 2

[0147]

[0148]

[0149] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and such modifications or substitutions are intended to be within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.

Claims

1. A robust heterogeneous graph contrastive learning method based on intrinsic pattern-preserving view generation, characterized by: The method includes: Constructing an original view based on input data, projecting heterogeneous node features located in different dimensional subspaces into a d-dimensional common space to obtain a transformed feature set; the input data includes a set of features consisting of papers, authors, and conferences; the heterogeneous node features include paper features, author features, and conference features; Constructing a relational subgraph based on the relationship of the input data and obtaining a corresponding adjacency matrix; constructing a feature-induced graph; and obtaining an intrinsic pattern view based on the adjacency matrix and the feature-induced graph; Extract node embeddings of intrinsic pattern views and original views using heterogeneous graph neural networks based on intrinsic pattern views, original views, and transformed feature sets; Calculating the metapath graphs of the original view and the intrinsic pattern view respectively, obtaining a sample set based on the metapath graph of the original view, and processing the sample set to obtain an initial sample set; obtaining a sample set to be merged based on the metapath graph of the intrinsic pattern view; fusing the sample set to be merged with the initial sample set according to a merging rule to obtain a positive sample set, and the remaining nodes in the sample set are negative sample sets; Projecting the node embeddings of the intrinsic pattern view and the original view into the same space to obtain a projected embedding, and calculating the contrast loss in combination with the positive sample set and the negative sample set; constructing a view regularizer and optimizing the contrastive learning model in combination with the contrast loss; The optimized comparison model is judged. If converged, the node embedding of the original view obtained by the optimized comparison model is used to output the prediction result of the category of the target node; the category is the semantic category; The method for obtaining the intrinsic mode view is: The feature-induced graphs of the head node and the tail node are fused with the adjacency matrix respectively, and the expression is: in, is the first feature similarity; is the second feature similarity, A r is the adjacency matrix with the head and tail node connection relationship r; I is the identity matrix; is the feature induced graph of the head node; is the tail node feature induction graph; φ + (r) and φ - (r) are mapping functions that map relation r to the types of its head node and tail node respectively; The mask matrix is ​​used to remove edges with weights less than the threshold to obtain the first candidate graph and the second candidate graph. The expression is: in, is the first candidate graph; is the second candidate graph; M r is the mask matrix; represents Hadamard product; ∈ represents threshold; The third candidate graph is obtained by filtering the adjacency matrix based on the same mask matrix. The expression is: in is the third candidate map; Use single-layer channel attention to fuse the feature-induced graph of the first candidate graph, the second candidate graph, the third candidate graph, and the adjacency matrix to obtain a dense adjacency matrix; The dense adjacency matrix is ​​subjected to a specific type of sparseness to obtain the final adjacency matrix A′ r , construct the intrinsic pattern view of the corresponding subgraph according to the final adjacency matrix; The intrinsic mode view of each relation subgraph is obtained and integrated to obtain the intrinsic mode view of the original view.

2. The robust heterogeneous graph contrastive learning method based on intrinsic pattern-preserving view generation according to claim 1, characterized in that The method for obtaining the conversion feature set includes: Projecting the heterogeneous node features into a d-dimensional common space through a layer of perceptrons to obtain node conversion features; Get the node conversion features of all nodes of the same type to obtain a conversion feature set.

3. The robust heterogeneous graph contrastive learning method based on intrinsic pattern-preserving view generation according to claim 1, characterized in that The feature induced graph includes a feature induced graph of an adjacency matrix, a head node feature induced graph, and a tail node feature induced graph; The method for obtaining the feature induced graph is: using a multi-head weighted cosine similarity function to calculate the feature similarity between node i and node j, the expression is: in, represents the Hadamard product; M is the number of heads; is the weight vector of the mth head-to-tail node connection relationship r; is the feature similarity between node i and node j; The feature similarity is used as the edge weight, and a feature induced graph is constructed based on the edge weight.

4. The robust heterogeneous graph contrastive learning method based on intrinsic pattern-preserving view generation according to claim 1, characterized in that The specific type of sparsification is k-nearest neighbor sparsification, which is expressed as: in, Represents a dense adjacency matrix row vector Front K φ-(r) Maximum values.

5. The robust heterogeneous graph contrastive learning method based on intrinsic pattern-preserving view generation according to claim 1, characterized in that The method for extracting node embeddings of the intrinsic pattern view and the original view is the same, and specifically includes the following steps: The original view and intrinsic pattern view are respectively encoded with the transformed feature set, and the obtained initial values ​​are used as the input of the l-layer heterogeneous graph neural network; In each layer of the heterogeneous graph neural network, the intermediate node embedding output by the previous layer is used as the input value of the current layer, node-level aggregation is performed first and then type-level aggregation is performed, and the intermediate node embedding after type-level aggregation is output; The output of the lth layer is taken as the final result to get the node embedding.

6. The robust heterogeneous graph contrastive learning method based on intrinsic pattern-preserving view generation according to claim 5, characterized in that The expression of node-level aggregation is: in, Indicates node level output; t indicates node type; t p represents the neighbor node type of type t node and p∈[1,J]; J represents the set of neighbor node types of type t node; r p Represents the connection relationship between neighbor node p and node t; The diagonal elements are degree matrix of ; is the element of m rows and m columns of the degree matrix; Represents the elements of the adjacency matrix m rows and n columns; is the trainable weight of layer l; He is the node type t in the lth hidden layer p Embedded and G∈(G IP ,G o ); Get the embedding of each type of neighbor node in turn The type-level aggregate expression is: in, Embedding for the intermediate nodes in layer l+1; is the normalized weight of each type of neighbor, which is expressed as: Represents the attention vector; 1 represents the all-1 vector; Represents a set of nodes of type t; Indicates the weight value of the neighbor node of type t is p; Indicates the weight value of the neighbor node j of type t.

7. The robust heterogeneous graph contrastive learning method based on intrinsic pattern-preserving view generation according to claim 1, characterized in that The method for obtaining the positive sample specifically includes the following steps: Calculate the meta-path graph of the original view, obtain the original view matrix based on the meta-path graph, and select the i-th row element corresponding to node i in the original view matrix; Select the nodes corresponding to the first preset maximum values ​​in the elements of the i-th row as the initialization sample set; Calculating a meta-path graph of the intrinsic mode view, obtaining an initial intrinsic mode view matrix based on the meta-path graph, and selecting nodes corresponding to a second preset number of maximum values ​​in the current initial intrinsic mode view matrix as a set of samples to be merged; the set of samples to be merged is at least one; The sample set to be merged is merged with the initialization sample set according to the merging rule to obtain positive samples.

8. The robust heterogeneous graph contrastive learning method based on intrinsic pattern-preserving view generation according to claim 7, characterized in that: The merging rule is: every third preset number of initialization sample set elements are merged into a sample set to be merged.

9. The robust heterogeneous graph contrastive learning method based on intrinsic pattern-preserving view generation according to claim 1, characterized in that The specific steps of optimizing the contrastive learning model are as follows: The node embedding is projected into the same space through two layers of perceptrons to obtain the projected embedding, which is expressed as: in, Node embedding representing the original view; Node embedding representing the intrinsic pattern view; Z O represents the projected embedding of the original view; Z IP Represents the projected embedding of the intrinsic pattern view; Based on the projection embedding, the positive and negative samples are used to calculate the view contrast loss of the corresponding nodes in the intrinsic pattern view and the original view, which is expressed as: in, represents the intrinsic pattern view contrast loss; represents the original view contrast loss; P i represents the positive sample set; j represents the node in the positive sample; N i represents the sum of the positive and negative sample sets; sim(·) represents the cosine similarity function; δ is the temperature coefficient; k represents the node in the union of the positive and negative samples; The contrast loss is calculated using the intrinsic pattern view contrast loss and the original view contrast loss, and the expression is: in, represents a node set; λ represents a hyperparameter for measuring the loss of different views; The view regularizer is constructed using cross entropy, and its expression is: Among them, G O represents the original view; G IP Represents the intrinsic mode view; represents the cross entropy, and Respectively represent node i in G O and G IP Degree in; vol(G O ) and vol(G IP ) represent G O and G IP volume; Combining contrastive loss and view regularizer to update the objective function of robust heterogeneous graph contrastive learning based on intrinsic pattern-preserving view generation is: L = L cl +γL reg , and γ is a trade-off parameter that controls the contribution of the regularizer.

Citation Information

Patent Citations

  • Abnormal event detection method and device, computer equipment and storage medium

    CN115114484A

  • General unsupervised heterogeneous graph representation learning method based on comparative learning

    CN115169529A