Robust heterogeneous graph comparative learning method generated based on intrinsic mode reservation view

By building an intrinsic pattern view and view regularizer, the heterogeneous graph comparison learning model is optimized, which solves the robustness of the heterogeneous graph comparison learning method under graph structure noise, and improves the accuracy of node classification.

CN119293479AActive Publication Date: 2025-01-10TONGJI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing heterogeneous graph comparison learning methods are susceptible to graph structure noise, resulting in node representations reflecting error relationships and increasing the possibility of error samples, thereby reducing network performance.

Method used

By constructing an intrinsic pattern view, node embedding is extracted using a heterogeneous graph neural network, and combining a view regularizer to optimize the comparison learning model, robust node representations are generated, reducing the impact of noise and improving classification accuracy.

Benefits of technology

Effectively eliminate noise edges and complete the lost edges, improve the robustness of heterogeneous patterns to noise, reduce the possibility of wrong samples, and improve the accuracy of node classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119293479A_ABST
    Figure CN119293479A_ABST
Patent Text Reader

Abstract

The invention relates to a robust heterogeneous graph comparative learning method generated based on an intrinsic mode reservation view. The method comprises the following steps: acquiring a conversion feature set; obtaining an intrinsic mode view; extracting node embedding of the intrinsic mode view and the original view; acquiring a positive and negative sample set; optimizing the contrast learning model; and judging the optimized comparison model, and if the comparison model converges, embedding and outputting a prediction result of the category to which the target node belongs by using the node of the original view obtained by the optimized comparison model. Compared with the prior art, the method has the advantages that the robustness of the heterogeneous graph surface to the graph structure noise is effectively improved, and the classification accuracy is improved.
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 the academic field, effective classification of entities such as paper topics, author research fields, and conference types is crucial to promote the retrieval of research results, the analysis of academic influence, and the management of academic resources. To this end, people have tried to use heterogeneous graphs to model the various entities (such as papers, authors, conferences) involved in academic research and their complex relationships, and learn the representation vector of each entity through heterogeneous graph neural networks (HGNNs) to achieve effective classification of each entity. However, labeled data is often scarce in practical applications, making it difficult for HGNNs trained with a (semi-)supervised learning paradigm that relies on a large number of labels to function. This has inspired various self-supervised learning methods for heterogeneous graph embedding to solve the problem of label scarcity, among which contrastive learning has received great attention recently. Its purpose is to learn node representations by maximizing the similarity between related pairs (positive samples) and minimizing the similarity between unrelated pairs (negative samples). Some work uses 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 usually assume that the original HG structure is reliable, so when the HG structure is affected by noise, such as adversarial attacks or missing edges, its network performance degrades significantly. There are two reasons why it is vulnerable to graph structure noise: 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 according to the graph structure in the generated views, which increases the possibility of wrong samples and forces different nodes to be closer, 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 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, citation, and conference name;

[0007] Construct a relational subgraph according to the relationship of the input data, and obtain a corresponding adjacency matrix; construct a feature induced graph; and obtain 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] The metapath graphs of the original view and the intrinsic pattern view are calculated respectively, a sample set is obtained based on the metapath graph of the original view, and the sample set is processed to obtain an initial sample set; a sample set to be merged is obtained based on the metapath graph of the intrinsic pattern view; the sample set to be merged is merged with the initial sample set according to the 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, and 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 a conversion feature set includes:

[0013] Projecting the heterogeneous node features to a d-dimensional common space via 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 graph 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 nodes connected in a relationship of r; I is the identity matrix; is the feature induced graph of the head node; is the tail node feature induced graph; φ + (r) and φ - (r) are mapping functions that map relation r to its head node and tail node types respectively;

[0024] The mask matrix is ​​used to remove the edges whose weights are 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 the Hadamard product; ∈ represents the threshold;

[0027] Based on the same mask matrix, the adjacency matrix is ​​filtered to obtain the third candidate graph, which is expressed as: in is the third candidate map;

[0028] A dense adjacency matrix is ​​obtained by fusing the feature induced graph of the first candidate graph, the second candidate graph, the third candidate graph and the adjacency matrix using a single-layer channel attention;

[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 embedding of the intrinsic mode view and the original view is the same, and specifically includes the following steps:

[0035] Encode the original view and the intrinsic pattern view with the transformed feature set respectively, 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 The degree matrix of is the element of m rows and m columns of the degree matrix; Represents the elements of the adjacency matrix with m rows and n columns; is the trainable weight of layer l; He is the node type t in the lth hidden layer p The embedding and G∈(G IP ,Go ).

[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 of layer l+1; is the normalized weight of each type of neighbor, and its expression is:

[0045]

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

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

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

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

[0050] Calculate a metapath graph of the intrinsic mode view, obtain an initial intrinsic mode view matrix according to the metapath graph, and select nodes corresponding to the 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;

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

[0052] 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.

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

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

[0055]

[0056] 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;

[0057] 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;

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

[0059]

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

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

[0062]

[0063] Among them, G O represents the original view; G IP Represents the intrinsic mode view; represents the cross entropy, and Respectively represent the node i in G O and G IP The degree of; vol(G O ) and vol(G IP ) represent G O and G IP Volume;

[0064] 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.

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

[0066] 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 complete lost edges; and improves positive sample selection through intrinsic pattern views, effectively improving the robustness of heterogeneous graphs to graph structural noise and reducing the possibility of erroneous samples;

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

[0068] Figure 1 It is a schematic diagram of the process of the present invention;

[0069] Figure 2 It is a structural schematic diagram of the comparative learning model of the present invention;

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

[0071] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0072] Unless otherwise defined, the technical terms or scientific terms involved in this application should be understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the" and the like involved in this application do not indicate a quantitative limitation, and may represent the singular or plural. The terms "include", "comprise", "have" and any of their variations involved 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 inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships, 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 ordering of the objects.

[0073] 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 the sample selection based on the intrinsic patterns to reduce the incidence of erroneous samples and improve the robustness of the model to graph structure noise in unsupervised scenarios, thereby improving the accuracy of node classification.

[0074] 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, introducing perturbations caused by distribution differences between feature similarities and potential interactions, thereby enhancing cross-view diversity. The feature induced graph is fused with the original noise graph by propagating feature similarities on the original structure 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.

[0075] Embodiment 1:

[0076] 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, the structure diagram of the comparative learning model is as follows Figure 3 As shown, the specific steps include:

[0077] S1. Get the conversion feature set:

[0078] S11, obtaining input data, and constructing an original view based on the input data, wherein the input data includes a set of features of categories including papers, authors, and conferences;

[0079] S12, heterogeneous node features x′ i The node conversion features are obtained by projecting them to 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:

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

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

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

[0083] S2. Get the intrinsic mode view:

[0084] S21, splitting the original view into relational subgraphs according to the relationships, wherein the relationships include the paper being written by the author, the paper being published at the conference, and the author attending a conference on a certain topic, etc.; and obtaining the adjacency matrix of the relational subgraphs;

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

[0086] 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, so feature similarity is used to recover the potential latent 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, and the expression is:

[0087]

[0088] 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; taking the feature similarity as edge weight, constructing a feature induced graph based on the edge weight;

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

[0090] Due to the difference in the distribution of 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;

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

[0092] like Figure 2 The adjacency matrix A is shown r In the noise in , where P0 and P1 with different labels are connected to the same author node A0, P0 and P1 may be misconnected under the meta-path PAP and the edge connecting P3 and A0 may be 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:

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

[0094]

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

[0096] S232, using a mask matrix to remove edges whose edge weights are less than a threshold value to obtain a first candidate graph and a second candidate graph, the expression is:

[0097]

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

[0099] S233, filtering the adjacency matrix based on the same mask matrix to obtain a third candidate graph, the expression is: in is the third candidate map;

[0100] S234, using 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:

[0101]

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

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

[0104]

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

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

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

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

[0109] 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 firstly 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:

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

[0111]

[0112] 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;

[0113] 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, node-level aggregation is first performed in each layer of the network, and then type-level aggregation is performed, and the type-level output value is encoded with the corresponding view, and the intermediate node embedding is output;

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

[0115]

[0116] 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 The degree matrix of is the element of m rows and m columns of the degree matrix; Represents the elements of the adjacency matrix with m rows and n columns; is the trainable weight of layer l; He is the node type t in the lth hidden layer p The embedding and

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

[0118] The type level aggregate expression is:

[0119]

[0120] in, Embedding for the intermediate nodes of layer l+1; is the normalized weight of each type of neighbor, and its expression is:

[0121]

[0122] represents the attention vector; 1 represents the all-1 vector; v t Represents a node set of type t; Indicates the weight value of the neighbor node of type t as p; Indicates the weight value of the neighbor node j of type t;

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

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

[0125] S41. Calculate the meta-path graph of the original view, and obtain the original view matrix C according to 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 values ​​are taken as the initial sample set, denoted as Used to initialize the positive sample set P i ;

[0126] 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;

[0127] 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 merged with the initial sample set to obtain a positive sample set, and the remaining nodes in the sample set are negative sample sets.

[0128] The generated G IP The weights of the real edges missing from the original graph are increased so that they can be retrieved from G IP Potential samples are identified in , thereby guiding the view generator. In this way, the positively sampled pairs and the view generator reinforce each other, resulting in improved node representations.

[0129] S5. Optimizing the contrastive learning model:

[0130] S51, projecting the node embedding to the same space through two layers of perceptrons to obtain projected embedding, the formula is:

[0131]

[0132] 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;

[0133] S52, based on the projection embedding, the positive sample and the negative sample are used to calculate the view contrast loss of the corresponding node in the intrinsic pattern view and the original view, and the expression is: 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;

[0134] S53, using the intrinsic pattern view contrast loss and the original view contrast loss to calculate the contrast loss, the expression is:

[0135]

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

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

[0138]

[0139] Among them, G O represents the original view; G IP Represents the intrinsic mode view; represents the cross entropy, and Respectively represent the node i in G O and G IP The degree of; vol(G O ) and vol(G IP ) represent G O and G IP Volume;

[0140] S55. Combining contrast 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.

[0141] S6. Output prediction results:

[0142] 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 includes 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.

[0143] Embodiment 2:

[0144] 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.

[0145] Common multivariate classification evaluation indicators are used, including Macro-f1, Micro-f1 and AUC. In order to further highlight the model effect, 9 benchmark methods are selected as comparison objects, and the experimental data are divided into Tables 1 and 2. In the table, the best performing model data is displayed in bold, and the second best results are displayed in underline. It can be seen from the test results data in the table that the VIP-HCL model provided by the present invention performs better than other models on most training sets, so the model provided by the present invention has excellent performance.

[0146] Table 1 Experimental results 1

[0147]

[0148]

[0149] Table 2 Experimental results 2

[0150]

[0151]

[0152] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A robust heterogeneous graph contrastive learning method based on intrinsic pattern preserving view generation, characterized in that The method includes: Constructing an original view based on input data, projecting heterogeneous node features located in subspaces of different dimensions into a d-dimensional common space to obtain a transformed feature set; the input data includes a set of features of papers, authors, and conferences; the heterogeneous node features include paper features, author features, and conference features; Construct a relational subgraph according to the relationship of the input data, and obtain a corresponding adjacency matrix; construct a feature induced graph; and obtain 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; The metapath graphs of the original view and the intrinsic pattern view are calculated respectively, a sample set is obtained based on the metapath graph of the original view, and the sample set is processed to obtain an initial sample set; a sample set to be merged is obtained based on the metapath graph of the intrinsic pattern view; the sample set to be merged is merged with the initial sample set according to the 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 contrast model is judged, and 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.

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 to a d-dimensional common space via 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 method for obtaining the intrinsic mode view is: The feature induced graph 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 induced graph; φ + (r) and φ - (r) are mapping functions that map relation r to its head node and tail node types respectively; The mask matrix is ​​used to remove the edges whose weights are 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 the Hadamard product; ∈ represents the threshold; Based on the same mask matrix, the adjacency matrix is ​​filtered to obtain the third candidate graph, which is expressed as: in is the third candidate map; A dense adjacency matrix is ​​obtained by fusing the feature-induced graph of the first candidate graph, the second candidate graph, the third candidate graph and the adjacency matrix using a single-layer channel attention; 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.

5. The robust heterogeneous graph contrastive learning method based on intrinsic pattern preserving view generation according to claim 4, 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.

6. 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 embedding of the intrinsic mode view and the original view is the same, and specifically includes the following steps: Encode the original view and the intrinsic pattern view with the transformed feature set respectively, 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.

7. The robust heterogeneous graph contrastive learning method based on intrinsic pattern preserving view generation according to claim 6, 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 The degree matrix of is the element of m rows and m columns of the degree matrix; Represents the elements of the adjacency matrix with m rows and n columns; is the trainable weight of layer l; He is the node type t in the lth hidden layer p The embedding 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 of layer l+1; is the normalized weight of each type of neighbor, and its expression is: Represents the attention vector; 1 represents the all-1 vector; Represents a node set of type t; Indicates the weight value of the neighbor node of type t as p; Indicates the weight value of the neighbor node j of type t.

8. 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 comprises the following steps: Calculate the meta-path graph of the original view, obtain the original view matrix according to the meta-path graph, and select the i-th row element corresponding to the node i in the original view matrix; Select the nodes corresponding to the first preset number of maximum values ​​in the i-th row of elements as the initialization sample set; Calculate a metapath graph of the intrinsic mode view, obtain an initial intrinsic mode view matrix according to the metapath graph, and select nodes corresponding to the 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 a merging rule to obtain a positive sample.

9. The robust heterogeneous graph contrastive learning method based on intrinsic pattern preserving view generation according to claim 8, 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.

10. 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 the optimization contrastive learning model are: 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: Where v represents the node set; λ represents the 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 the node i in G O and G IP The degree of 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