Flexible graph comparative learning method and device based on representation subspace decoupling
By decoupling the representation subspace and using flexible graph contrastive learning, the problems of enhancing sample quality and semantic consistency in graph contrastive learning are solved, achieving better topological feature capture and node representation generalization, thus improving the performance of downstream tasks.
Patent Information
- Application Number
- CN202410768560.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2025-12-16
AI Technical Summary
Existing graph contrastive learning methods are susceptible to low-quality data augmentation, making it difficult to effectively capture topological differences. Furthermore, the assumption that augmented samples have semantic consistency may mislead training, leading to suboptimal node representations.
A flexible graph contrastive learning method with decoupling of representation subspaces is adopted. Node representation vectors are generated by a graph encoder and decoupled to low-rank, sparse, and noisy subspaces. A loss function is constructed using the soft similarity of mixed samples, and the encoder is trained by combining subspace loss.
It improves the model's ability to capture fine-grained features and enhances its robustness and generalization ability for downstream tasks, especially performing well in node classification and graph classification tasks.
Smart Images

Figure CN121145918A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of information technology, and particularly relates to a flexible graph contrast learning method and device based on representation subspace decoupling. BACKGROUND
[0002] Graph data, as a widely existing data type in the real world, depicts the associated attributes between object elements, such as social networks, citation networks, molecular networks, transportation networks and various structural data, as shown in FIG. 1. As a typical non-Euclidean data, graph data has a complex structure and contains rich topological information. The representation learning of graph data has always been a research hotspot. By mapping the structured graph data to a dense vector space, and then using the dense representation vector for node classification, graph classification, link prediction and other tasks, it has been widely applied in recommendation systems, drug discovery, community discovery, financial risk control and other fields. Figure 1
[0003] In recent years, many methods have focused on graph neural networks, and their goal is to optimize the training of a graph encoder with excellent performance to map the original node features and structural information to a dense vector space. As a representative method of self-supervised graph contrast learning, it has achieved remarkable results. The key idea is to use graph enhancement methods to perform enhancement operations on the original graph to obtain two or more enhanced graphs, and then use positive and negative nodes or graphs as enhancement signals to optimize the training process of the graph encoder. In this way, the similarity relationship between similar nodes in the semantic space can be constrained, thereby obtaining an optimized supervision signal for self-supervised learning of graph neural networks.
[0004] The current mainstream graph contrast learning model can be divided into three main components: a graph enhancement module, a graph encoding module, and a loss module. The graph enhancement module obtains different enhanced graphs by masking the topological structure and original features of the graph. The graph encoding module maps the structured graph data to a dense vector space through a graph neural network to help fuse the structural features and original features. The loss module optimizes the encoder parameters by maximizing the mutual information between positive samples and minimizing the mutual information between positive and negative samples. For example, the GCA method proposes an adaptive enhanced graph contrast learning method. Specifically, it proposes a joint and adaptive graph enhancement method at the topological structure and node attribute level, then generates two related enhanced graphs, and finally uses a node-level contrast loss function to train the model, maximizing the consistency between the node representation vectors in the two views, so as to output the optimized node representation vectors.
[0005] The existing technology mainly has the following problems:
[0006] (1)Current graph contrastive learning research usually relies on manually designed or automatically learned graph augmentation methods, which are vulnerable to low-quality data augmentation. For example, the difference between different augmented graphs is small, which makes the encoder unable to capture enough information difference, and the difference between different augmented graphs is too large, which misleads the encoder learning, which may hinder the contrastive learning to capture mutual information difference, resulting in learning suboptimal node representation.
[0007] (2)Most current graph contrastive learning methods mainly use subgraph sampling to capture the topological structure information of node representation, which has shortcomings in comparing different topological structures and cannot well model local structures (such as triangular structures), which affects the model's ability to capture subtle topological structure differences and thus affects the model's performance.
[0008] (3)Most current graph contrastive learning methods follow a basic assumption that the augmented samples of the same original sample are considered as completely identical positive samples, but this assumption is not always true. For example, removing a carbon atom in the benzene ring of aspirin will degrade it into an olefin chain, and removing a key central node in a social network will affect community division. These augmentations may mislead the training process of the graph encoder, causing the model to learn incorrect information. SUMMARY
[0009] The present application is directed to the above problems, and provides a flexible graph contrastive learning method and device based on representation subspace decoupling.
[0010] The technical scheme adopted by the present application is as follows:
[0011] A flexible graph contrastive learning method based on representation subspace decoupling, comprising the following steps:
[0012] obtaining augmented views of the original graph;
[0013] obtaining node representation vectors using a graph encoder according to the augmented views;
[0014] decoupling the node representation vectors into different subspaces;
[0015] generating mixed samples by mixing the original samples, constructing a loss function by the soft similarity of the mixed samples in the subspaces, and training the graph encoder by the loss functions of multiple subspaces.
[0016] Further, the obtaining of the augmented views of the original graph comprises generating different views using attribute augmentation and structure augmentation, which is represented as:
[0017]
[0018]
[0019]
[0020] where X denotes the feature matrix of nodes on the original graph, A denotes the adjacency matrix of the original graph, X ′ denotes the enhanced node feature matrix, A ′ denotes the enhanced adjacency matrix, denotes the enhanced view, M is the attribute mask matrix, which is independently sampled from the Bernolli distribution with probability p1; R is the random edge mask matrix, which is sampled from the Bernoulli distribution with probability p2; t(·) denotes the combination of structure enhancement and attribute enhancement, obtaining the enhanced view with difference, helping the model to better construct the contrastive sample.
[0021] Further, the graph encoder adopts a graph convolutional network to generate the expression vector of the current node by continuously aggregating the information of the neighbor nodes, and each graph convolutional network layer is defined as:
[0022]
[0023] where H l+1 is the node representation vector obtained by the (l+1)th layer of graph convolution, W l is the weight vector of the lth layer of graph convolution, σ is an activation function, H (0) is the original feature matrix of the node, is the adjacency matrix with self-connection added, is the degree matrix, and σ(·) is an activation function; a two-layer graph convolutional network is used as the graph encoder, and a convolution operator is used to describe the local structure of the node, and a pooling operator is used to learn the hierarchical representation of the network, and the structure information and attribute information are mapped to a low-dimensional dense vector space.
[0024] Further, the node representation vector is decoupled into different subspaces, including decomposing the original representation space H into three subspaces:
[0025] H=L+S+N
[0026] where the low-rank subspace representation L allows linear combination between nodes, focusing on the representation of the structure information of the node; the sparse subspace representation S reduces the redundancy in the representation, highlighting the essential features of the node, focusing on the representation of the attribute information of the node; and the noise subspace representation N retains the residual in the approximation, used to separate the irrelevant information of the node in the graph contrastive learning.
[0027] Further, the original representation space H is decomposed into three subspaces by optimizing the following problem:
[0028]
[0029] s.t.rank(L)≤r
[0030] card(S)≤k
[0031] where ∈ is the decomposition error, F is the Frobenius norm, rank(·) is the rank of the matrix, card(·) is the sparsity of the matrix, and r and k are the threshold values of the constraint matrix; the following two sub-problems are solved iteratively using the GoDec algorithm:
[0032]
[0033] where L t represents the low-rank subspace representation at the t-th step of decomposition, and S t represents the sparse subspace representation at the t-th step of decomposition.
[0034] Further, the loss function is constructed by the soft similarity of the mixed samples in the subspace, including:
[0035] Two original samples are mixed by linear interpolation to generate a mixed sample, and the mixing ratio between the two original samples is recorded as the similarity of the mixed sample and the two original samples, which finely guides the similarity of the sample representation in the contrast learning, and realizes flexible graph contrast learning.
[0036] Further, the graph encoder is trained by the loss function of the joint multiple subspaces, and the total loss is:
[0037]
[0038] where ρ∈(0,1) is a harmonic factor for balancing the contrast constraint strength of the low-rank subspace representation and the sparse subspace representation, represents the contrast loss, L1 and L2 represent the low-rank subspace node vector matrix, and S1 and S2 represent the sparse subspace node vector matrix.
[0039] A flexible graph contrast learning device based on representation subspace decoupling, comprising:
[0040] An enhanced view generation module is configured to obtain an enhanced view of an original graph.
[0041] A graph encoder module is configured to obtain a node representation vector based on the enhanced view.
[0042] A subspace decomposition module is configured to decouple the node representation vector into different subspaces.
[0043] A node flexible mixing module is configured to generate a mixed sample by mixing original samples, and to construct a loss function by the soft similarity of the mixed samples in the subspace.
[0044] The loss function module is configured to obtain a total training loss by combining loss functions of multiple subspaces, and is configured to train the graph encoder.
[0045] The application provides a method for mapping structured graph data into dense representation vectors, and applies a decoupling strategy based on subspace decomposition and a node flexible mixing technology, to help a graph contrast learning model capture different fine-grained aspect-level features and better downstream task performance, and has the following advantages:
[0046] 1) The application helps the model to obtain more fine-grained aspect-level features by decoupling different subspaces: the low-rank subspace is used to help the model capture topological structure features, the sparse subspace is used to help the model compress redundant information and capture essential node attribute features, and the noise subspace is used to separate task-independent noise.
[0047] 2) The application applies a node flexible contrast technology in different subspaces, trains the graph encoder by using the soft similarity of the mixed samples, and helps the model to show better robustness in downstream tasks. BRIEF DESCRIPTION OF DRAWINGS
[0048] Figure 1 is a representative graph data example graph.
[0049] Figure 2 is a graph contrast learning method flowchart based on subspace flexible mixing.
[0050] Figure 3 is a t-SNE visualization contrast graph. DETAILED DESCRIPTION
[0051] The application will be further described in detail below through specific embodiments and drawings.
[0052] The graph contrast learning basic framework constructed by the application proposes a method based on subspace flexible mixing enhancement, which helps the model to capture fine-grained differences by decoupling different subspaces and flexibly mixing nodes, and improves the generalization ability. Specifically:
[0053] (1) Design a subspace decomposition method to capture different aspect-level features using different subspaces, the application decouples node representation into different subspaces to capture node topological information and attribute information, respectively, so as to help the model to compare from different aspects and strengthen the comparison of graph topological structure.
[0054] (2) Design a node flexible contrast method, generate mixed samples by interpolation operation, and use the soft similarity of the mixed samples to construct a loss function, so as to realize flexible node mixing enhanced graph contrast learning, avoid wrong node enhancement, and help the model to fine contrast according to the similarity.
[0055] (3) The loss function is constructed by the soft similarity of the mixed samples in the subspace, which can simultaneously flexibly mix and compare the topological information and attribute information, and then simultaneously utilize the advantages of subspace decomposition and flexible comparison method. The encoder is trained by combining multiple subspace loss functions, which helps the model capture fine-grained differences while improving the generalization ability.
[0056] The scheme first obtains an enhanced view of the original graph and utilizes a graph neural network (graph encoder) to obtain a node representation vector, then decouples the node representation vector into different subspaces, and finally trains the graph encoder in different subspaces by flexibly mixing nodes. The present application mainly includes five parts: an enhanced view generation module, a graph encoder module, a subspace decomposition module, a node flexible mixing module and a loss function module (total training loss). The process of the present application is shown in Figure 2 The two enhanced views A and B are generated by using the enhanced view generation module, and then the node representation vector is obtained by using the graph encoder, and then the subspace decomposition module and the node flexible mixing module are applied step by step, and finally the model is trained by using the total loss function of the loss function module to adjust the parameters of the graph encoder.
[0057] (1) Enhanced view generation module
[0058] For a given original graph Wherein represents a set of nodes, represents a set of edges, X represents a feature matrix of nodes on the graph, X i represents the feature vector of the i-th node, n is the number of nodes, d is the feature dimension of the node, represents the adjacency matrix of the graph, indicating the edge relationship between the nodes on the graph, A i = 1 when and only when (v j ,v ij )∈ε, otherwise A ij = 0.
[0059] In this method, two classical augmentation techniques are used to generate different views, namely attribute enhancement and structure enhancement operation:
[0060]
[0061]
[0062]
[0063] Wherein, X' represents the enhanced node feature matrix, A' represents the enhanced adjacency matrix, represents the enhanced graph, M∈{0,1} n×dis a property mask matrix, which is sampled independently from Bernoulli distribution with probability P1; R e {0, 1} n×n is a random edge mask matrix, which is also sampled from Bernoulli distribution with probability p2; is Hadamard product; t(·) represents the combination of the two enhancements. By combining structural enhancement and attribute enhancement, an enhanced graph with diversity is obtained, which helps the model to better construct contrastive samples.
[0064] (2) Graph encoder module
[0065] As the main tool for encoding structured graph data into low-dimensional dense vectors, graph neural networks have been widely applied to graph representation learning. As a representative method in graph data network, graph convolutional network captures the structure and attribute information in the graph using convolutional and pooling operators. In this method, graph convolutional network (GCN) is used as the encoder f(·) to obtain node features. Specifically, graph convolutional neural network generates the expression vector of the current node by continuously aggregating the information of neighboring nodes. Each GCN layer can be defined as:
[0066]
[0067] where H l+1 is the node representation vector obtained by the (l+1)th layer graph convolution, W l is the weight vector of the lth layer graph convolution, and σ is the activation function, such as ReLu, H (0) is the original feature matrix X of the node, is the adjacent matrix with added self-connection, is the degree matrix, and σ(·) is the activation function, such as ReLU(·).
[0068] In this method, two-layer graph convolutional network is used as the encoder, convolutional operator is used to describe the local structure of the node, and pooling operator is used to learn the hierarchical representation of the network, so as to map the structure information and attribute information to the low-dimensional dense vector space.
[0069] (3) Subspace decomposition module
[0070] Most of the current graph contrastive learning methods have deficiencies in the contrast of different topological structures, and cannot well distinguish local structures. Existing research shows that a low-rank matrix can allow linear combinations between mathematical representations, and is used to depict node representations that can maintain the intrinsic structural correlation of nodes, such as triangular structures; a sparse matrix can reduce redundant information, and is used to depict node representations that can compress original redundant representations and encourage the model to focus on the essential attribute features of nodes. Therefore, the present application hopes to introduce the related theory of low-rank sparse matrix decomposition into graph contrastive learning. Specifically, after obtaining the node representation vector through the graph encoder, the present application decouples the node representation vector into different subspaces, assuming that H≈L+S, wherein L represents a low-rank subspace representation, S represents a sparse subspace representation, and another noise subspace representation N is used to complete the approximation, so that the present application decomposes the original representation space into three subspaces:
[0071] H=L+S+N (5)
[0072] Among them, the low-rank subspace representation L allows linear combinations between nodes, providing rich modeling capabilities for structural correlation, such as triangular structures, focusing on the structural information of node representations. In addition, the sparse subspace representation S reduces the redundancy in the representation, thereby highlighting the essential features of the nodes, focusing on the attribute information of the node representations. In addition, the noise subspace representation N retains the residual in the approximation, which can be used to separate irrelevant information of nodes in graph contrastive learning, such as low-quality noise that may exist in random data augmentation in the enhanced view generation module.
[0073] In the implementation, formula (5) can be realized by optimizing the following problem:
[0074]
[0075] Where ∈ is the decomposition error, F is the Frobenius norm, rank(·) is the rank of the matrix, and card(·) is the sparsity of the matrix (i.e., the number of non-zero elements). r and k are threshold values of the constraint matrix. In order to solve this optimization problem, the present application uses the GoDec algorithm, which is one of the most effective decomposition algorithms, and is realized by iteratively solving the following two subproblems:
[0076]
[0077] Wherein, L t represents the low-rank subspace representation at the t-th step of decomposition, S t represents the sparse subspace representation at the t-th step of decomposition.
[0078] By decoupling different subspaces, the present method helps the model to better distinguish representation information of different aspect levels and helps the model to focus on more fine-grained information while reducing task-irrelevant noise.
[0079] (4) Node Flexible Hybrid Module
[0080] Most current graph contrastive learning methods follow a basic assumption: augmented samples, derived from the same original sample through random data augmentation, are semantically consistent with the original sample, and are treated as semantically identical positive samples for "hard" training. However, in real-world environments, random data augmentation can result in augmented samples with significant semantic differences. Forcing the model to generate approximate representations of the original and augmented samples may impair model performance. To address this, this invention proposes a node-flexible contrastive method. It uses linear interpolation to mix up two original samples to generate a mixed sample (augmented sample), and records the mixing ratio between the two original samples as the similarity between the mixed sample and the two original samples. Furthermore, the "soft" similarity of the mixed sample is used as the positive example weight in contrastive learning. In this way, this invention records the similarity relationship between the generated augmented sample and the original sample, and uses this similarity to finely guide the model's sample representation similarity in contrastive learning, achieving "flexible" contrastive learning. This avoids the potential inconsistency between sample representation and actual semantics inherent in current hard contrastive learning methods.
[0081] In terms of implementation, this invention designs a node-flexible hybrid module. (For the diagram...) Each node v in i First, define a one-hot encoded pseudo-label vector P. i = [0,…,1,…,0]∈{0,1} n Where n is the number of nodes in the graph, and P i,i =1, indicating that the value of the i-th dimension in the i-th node vector is 1. Intuitively, the pseudo-label vector records the value of a node in a training batch. The index in the table helps the blended node locate the position of the (two) original nodes before blending, encouraging the blended node to be aware of the "soft" similarity between the blended node and the original nodes when training the loss.
[0082] λ∽Beta(α,β) (8)
[0083] h′ i =λh i +(1-λ)h j (9)
[0084] P′ i =λP i +(1-λ)P j (10)
[0085] Where λ∈[0,1] is the scalar mixing ratio sampled from the Beta(α,β) distribution, α and β are the parameters of the Beta distribution, and hi vector representation of node v i vector representation of node v i vector representation of mixed node; P' i pseudo label vector of mixed node, satisfying P' i,i = λ and P' i,j = 1- λ, which is used to record the mixing ratio of the i th node and the j th node.
[0086] In the mixed setting, the mixed sample z' in each subspace is relative to There are two positive samples and (N-2) negative samples, where vector representation of node vector after projection by two-layer perception machine. Therefore, the following contrast loss (multi-pair sample contrast loss) is introduced for the i th node:
[0087]
[0088] where Z' represents a matrix of all mixed node vectors of an enhanced graph, represents a matrix of all node vectors of another enhanced graph, N represents the number of nodes, and P' i,j records the mixing ratio of the i th node and the j th node, which is obtained from formula (10). represents the cosine similarity between the representations of two nodes, and τ represents the temperature coefficient.
[0089] In this setting, the "soft" similarity introduced by the mixed sample enables the model to avoid regarding the samples before and after enhancement as completely similar positive examples, and reduces the possibility of learning incorrect information. Compared with the traditional graph contrast learning method, this method no longer strictly separates positive examples and negative examples in the representation space, but gives the positive and negative examples a weight according to the similarity, so the present application is called "flexible contrast".
[0090] (5) total training loss
[0091] In order to better utilize the structural information and attribute information and finely learn the node contrast from different aspects, the present application proposes to apply flexible contrast to L and S respectively. Compared with applying flexible contrast to the original node representation H, applying flexible contrast to L and S can comprehensively utilize the advantages of flexible contrast and subspace decomposition, fully utilize the structural information and attribute information, and finely depict the similarity degree of the original sample and the enhanced sample. Under the guidance of this idea, the total loss designed by the present application can be constructed as:
[0092]
[0093] Wherein, the harmonic factor ρ is in (0, 1), which is used to balance the strength of the contrast constraint on the low-rank subspace representation and the sparse subspace representation, L1, L2 represent the low-rank subspace node vector matrix, and S1, S2 represent the sparse subspace node vector matrix.
[0094] In summary, the application can train a good encoder, then use the encoder to obtain the representation of the node or graph as the initialization representation of the downstream task (node classification, graph classification, link prediction), and then fine-tune for specific tasks to improve the performance of the downstream task.
[0095] Specifically, the application can be used in the following specific tasks and specific application scenarios:
[0096] 1) Node classification
[0097] First, the method of the application is used for self-supervised pre-training on graph data (commodity network, social network) to obtain a good graph encoder, then the pre-trained graph encoder is used to generate vector representation for each node in the graph data (commodity network, social network), and a two-layer perception machine is used as a classifier on this basis, so that the nodes in the graph data (commodity network, social network) are classified into different categories, which can be used for user portrait, commodity recommendation and other target tasks.
[0098] 2) Graph classification
[0099] First, the method of the application is used for self-supervised pre-training on graph data (commodity network, social network) to obtain a good graph encoder, then the pre-trained graph encoder is used to generate vector representation for each node in the graph data (commodity network, social network), and a two-layer perception machine is used as a classifier on this basis, so that the nodes in the graph data (commodity network, social network) are classified into different categories, which can be used for user portrait, commodity recommendation and other target tasks.
[0100] 3) Link prediction
[0101] Through the method of the application, a good graph encoder is obtained by self-supervised pre-training on graph data (commodity network, social network), then the pre-trained graph encoder is used to generate vector representation for each node in the graph data (commodity network, social network), and on this basis, the potential relationship between the nodes is mined and new connections are predicted. For example, the relationship between users in a social network is predicted, and the association between entities in a knowledge graph is predicted.
[0102] The application constructs a set of flexible graph contrast learning models for decoupling representation subspaces, and the key points include:
[0103] (1) Graph representation decoupling method based on subspace decomposition
[0104] With the deepening of the research of graph contrastive learning, how to obtain high-quality samples by using graph enhancement technology has become a problem to be solved. At present, most methods obtain enhanced graphs through manual trial or automatic learning enhancement strategy, but such disturbance of topological structure or original features cannot determine whether it is helpful for the training of graph contrastive learning. Therefore, the invention uses subspace decomposition technology to decouple the enhanced node representation into different subspaces, uses the low-rank subspace to capture the topological structure features, uses the sparse subspace to compress the redundant information, and uses the noise subspace to remove the task-independent noise, thereby enhancing the training of the model.
[0105] (2) Flexible contrast training method based on node mixed similarity
[0106] At present, most graph contrastive learning follows a basic assumption that multiple enhanced samples of an original sample are completely similar positive samples. Such assumption is not always true and may mislead the training process of the graph encoder. Therefore, the invention proposes a node flexible contrast training method, introduces soft similarity by using mixed samples in the same subspace, helps the encoder to apply different intensities of contrast learning constraints in the training according to the similarity of the samples, so that high-similarity samples have higher contrast learning weights, and low-similarity samples have lower contrast learning weights, thereby more finely constraining the similarity relationship of the graph nodes in the representation space, and further obtaining better generalization ability of the graph node representation.
[0107] (3) Graph contrastive learning framework based on combination of subspace decomposition and node flexible contrast
[0108] The invention organically combines subspace decomposition and node flexible mixing method. The former uses different subspaces, low-rank subspace to capture local features, sparse subspace to compress redundant information, and noise subspace to decouple task-independent noise, to provide a good semantic representation space for subsequent node flexible mixing. The latter helps the model to have different school weights for samples with different similarity degrees in different subspaces by using the flexible similarity brought by mixed nodes, more fine-grained contrast learning, so as to have better generalization ability for graph node representation, provide higher-quality representation vectors for downstream tasks, and significantly improve the performance on node classification, graph classification and link prediction tasks.
[0109] The invention performs experiments on node classification and graph classification tasks, as shown in Tables 1 and 2.
[0110] Finally, the invention compares the learned representation of the invention with the learned representation of GrpahCL by t-SNE visualization, and intuitively shows the difference between the two, as shown in Figure 3As shown. Compared with other methods, it can be observed that the present application has better inter-class boundary clarity on multiple data sets. On the IMDB-B data set, the present application shows better intra-cluster compactness and inter-cluster separation than GraphCL, and on the IMDB-M and PROTEINS data sets, the present application shows better inter-class boundary clarity.
[0111] Table 1. Comparison of node classification task accuracy with existing methods
[0112] Method Cora Citeseer Pubmed Amazon-Photo Coauthor-CS GCN 81.7±0.4 70.5±0.3 79.4±0.4 87.3±1.0 91.8±0.1 GAT 83.0±0.7 72.5±0.7 79.0±0.3 86.2±1.5 90.5±0.7 SGC 81.5±0.2 73.1±0.1 79.7±0.4 88.3±1.1 91.5±0.3 DGI 81.7±0.6 71.5±0.7 77.3±0.6 83.1±0.3 90.0±0.3 GMI 82.7±0.2 73.0±0.3 80.1±0.2 85.1±0.0 91.0±0.0 MVGRL 82.9±0.7 72.6±0.7 79.4±0.3 87.3±0.1 91.3±0.1 GRACE 81.7±0.4 71.5±0.5 80.7±0.1 81.8±0.8 90.1±0.8 MERIT 83.1±0.6 74.0±0.7 80.1±0.4 88.8±0.4 92.4±0.4 SUGRL 83.4±0.5 73.0±0.5 81.9±0.5 88.9±0.2 93.2±0.5 S3-CL 84.5±0.4 74.6±0.4 80.8±0.3 89.0±0.5 93.1±0.4 SubMixGCL 88.7±0.2 77.3±0.5 89.3±0.4 96.3±0.1 93.9±0.3
[0113] Table 2. Comparison of graph classification task accuracy with existing methods
[0114] Method IMDB-B IMDB-M COLLAB PROTEINS MUTAG Node2Vec 50.2±0.9 36.0±0.7 - 57.5±3.6 72.6±10.2 Sub2Vec 55.3±1.5 36.7±0.8 - 53.0±5.6 61.1±15.8 Graph2Vec 71.1±0.5 50.4±0.9 - 73.3±2.1 83.2±9.3 InfoGraph 73.0±0.9 49.7±0.5 70.7±1.1 74.4±0.3 89.0±1.1 GraphCL 71.1±0.4 48.6±0.7 71.4±1.2 74.4±0.5 86.8±1.3 JOAO 70.2±3.1 49.2±0.8 69.5±0.4 74.6±0.4 87.4±1.0 MVGRL 74.2±0.7 51.2±0.5 - 71.5±0.3 89.7±1.1 AutoGCL 73.3±0.4 - 70.1±0.7 75.8±0.4 88.6±1.1 SimGRACE 71.3±0.8 - 71.7±0.8 75.4±0.1 89.0±1.3 SubMixGCL 98.8±0.2 75.3±2.3 83.2±0.4 92.1±1.1 91.3±1.2
[0115] Another embodiment of the present application provides a flexible graph contrast learning device based on representation subspace decoupling, which comprises:
[0116] An enhanced view generation module is configured to obtain an enhanced view of the original graph.
[0117] A graph encoder module is configured to obtain a node representation vector according to the enhanced view.
[0118] A subspace decomposition module is configured to decouple the node representation vector into different subspaces.
[0119] A node flexible mixing module is configured to generate a mixed sample by mixing the original sample, and to construct a loss function by the soft similarity of the mixed sample in the subspace.
[0120] A loss function module is configured to obtain a total training loss by combining the loss functions of multiple subspaces, and to train the graph encoder.
[0121] The specific implementation process of each module can be referred to the description of the method of the present application.
[0122] Another embodiment of the present application provides a computer device (computer, server, smart phone, etc.), which comprises a memory and a processor, the memory stores a computer program, the computer program is configured to be executed by the processor, and the computer program comprises instructions for executing each step of the method of the present application.
[0123] Another embodiment of the present application provides a computer readable storage medium (such as ROM / RAM, magnetic disk, optical disk), which stores a computer program, and the computer program is executed by a computer to realize each step of the method of the present application.
[0124] While the foregoing detailed description has set forth various specific embodiments of the application, it is to be understood that the disclosure is not to be limited to the details of construction or the arrangement of parts as set forth in the foregoing description. The foregoing detailed description is to be considered in all respects only as illustrative and not as restrictive.
Claims
1. A flexible graph contrastive learning method based on representation subspace decoupling, characterized in that, Includes the following steps: Obtain an enhanced view of the original graph; Based on the enhanced view, the node representation vectors are obtained using a graph encoder. Decouple the node representation vectors to different subspaces; A mixed sample is generated by mixing the original samples, a loss function is constructed by the soft similarity of the mixed samples in the subspace, and a graph encoder is trained by combining the loss functions of multiple subspaces.
2. The method according to claim 1, characterized in that, The process of obtaining enhanced views of the original graph includes generating different views using attribute enhancement and structural enhancement, as follows: Where X represents the feature matrix of nodes in the original graph, A represents the adjacency matrix of the original graph, X′ represents the enhanced node feature matrix, and A′ represents the enhanced adjacency matrix. The augmented view is represented by M, which is an attribute mask matrix that is independently sampled from the Bernoulli distribution with probability p1; R is a random edge mask matrix that is sampled from the Bernoulli distribution with probability p2; t(·) represents the combination of structural augmentation and attribute augmentation to obtain a differential augmented view, which helps the model to better construct contrast samples.
3. The method according to claim 1, characterized in that, The graph encoder uses a graph convolutional network to generate the representation vector of the current node by continuously aggregating information from neighboring nodes. Each graph convolutional network layer is defined as follows: Among them, H l+1 The node representation vector W is obtained through graph convolution at layer l+1. l Here, σ is the weight vector of the graph convolution at layer l, and H is the activation function. (0) It is the original feature matrix of the nodes. It is an adjacency matrix with added self-connections. σ is the degree matrix, and σ(·) is the activation function. A two-layer graph convolutional network is used as a graph encoder. The convolution operator is used to characterize the local structure of the nodes, and the pooling operator is used to learn the hierarchical representation of the network, mapping the structural information and attribute information to a low-dimensional dense vector space.
4. The method according to claim 1, characterized in that, The step of decoupling node representation vectors into different subspaces includes decomposing the original representation space H into three subspaces: H = L + S + N Among them, the low-rank subspace representation L allows linear combinations between nodes and focuses on the representation of the structural information of nodes; the sparse subspace representation S reduces redundancy in the representation, highlights the essential features of nodes, and focuses on the representation of the attribute information of nodes; the noisy subspace representation N preserves the residuals in the approximation and is used to separate irrelevant information of nodes in graph contrast learning.
5. The method according to claim 4, characterized in that, The decomposition of the original representation space H into three subspaces is achieved by optimizing the following problem: Where ∈ is the decomposition error, F is the Frobenius norm, rank(·) is the rank of the matrix, card(·) is the sparsity of the matrix, and r and k are the thresholds of the constraint matrix; the following two subproblems are solved iteratively using the GoDec algorithm: Among them, L t S represents the low-rank subspace representation when decomposing at step t. t The sparse subspace representation is given when decomposing at step t.
6. The method according to claim 1, characterized in that, The method of constructing a loss function using the soft similarity of mixed samples in a subspace includes: Two original samples are mixed using linear interpolation to generate a mixed sample, and the mixing ratio between the two original samples is recorded as the similarity between the mixed sample and the two original samples. Based on the similarity, the similarity of sample representations in contrastive learning is finely guided to achieve flexible graph contrastive learning.
7. The method according to claim 1, characterized in that, The graph encoder, trained by combining loss functions from multiple subspaces, employs a total loss function. for: Where ρ∈(0,1) is the harmonic factor, used to balance the contrastive constraint strength between the representation of low-rank subspaces and the representation of sparse subspaces. express In contrasting loss, L1 and L2 represent the low-rank subspace node vector matrices, and S1 and S2 represent the sparse subspace node vector matrices.
8. A flexible graph contrast learning device based on representation subspace decoupling, characterized in that, include: The enhanced view generation module is used to obtain an enhanced view of the original image; The graph encoder module is used to obtain node representation vectors from the enhanced view; The subspace decomposition module is used to decouple node representation vectors into different subspaces; The node flexible mixing module is used to generate mixed samples by mixing original samples and construct a loss function through the soft similarity of mixed samples in the subspace; The loss function module is used to obtain the total training loss by combining the loss functions of multiple subspaces, which is used to train the graph encoder.
9. A computer device, characterized in that, It includes a memory and a processor, the memory storing a computer program configured to be executed by the processor, the computer program including instructions for performing the method of any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a computer, implements the method according to any one of claims 1 to 7.