Graph classification system and method combining multi-semantic view and adaptive contrast learning

By combining multi-semantic view and adaptive comparison learning methods, the high-order structural features of the graph are extracted and node representation is optimized, which solves the problem of single-view description and over-smooth in graph classification, and achieves higher graph classification accuracy and model Great.

CN119206282APending Publication Date: 2024-12-27GUANGXI NORMAL UNIV

Patent Information

Application Number
CN202410849938.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-27
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

Traditional graph classification tasks usually describe graph data from a single perspective, ignore the multiple semantic information contained in the graph, and the algorithm that extracts semantic information by superimposing multiple convolutional layers has excessive smoothing problems, resulting in node representations tending to be consistent, and the information is Lost.

Method used

Using the combined multi-semantic view and adaptive contrast learning method, high-order structural features are extracted through WL remarking algorithm and word embedding model, adaptively generate enhanced graphs and optimize node feature expression through contrast learning across semantic view, using attention mechanism Merge node representations of multiple views to generate richer and more comprehensive graph embeddings.

Benefits of technology

It effectively alleviates the problem of oversmoothing, improves the accuracy of graph classification and the robustness of the model. The experimental results show that the average graph classification accuracy on multiple data sets has been improved by 6%, which is significantly better than the existing technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119206282A_ABST
    Figure CN119206282A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of graph neural networks, and discloses a multi-semantic view and adaptive contrast learning combined graph classification system and method, and the system comprises a multi-semantic view extraction module which captures high-order structure features through a WL remarking algorithm and a word embedding model, and extracts graph features from different semantic views; the self-adaptive comparative learning module is used for reserving important node features from a plurality of semantic views by self-adaptively generating an enhancement graph and enhancing the relationship among the views through comparative learning of cross-semantic views, and the self-adaptive comparative learning is used for optimizing the expression of the node features through consistency loss; the multi-semantic view fusion module uses an attention mechanism to merge node representations from a plurality of views to distinguish importance of nodes in different views so as to generate richer and more comprehensive graph embedding.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of graph neural networks, and in particular, relates to a graph classification system and method combining multiple semantic views and adaptive contrastive learning. Background Art

[0002] Graph data is an abstract data type that describes the relationship between objects. It is widely present in the real world, such as social networks, transportation networks, biomedical networks, etc. Graph classification is a crucial graph-level task in graph analysis. Common applications include predicting community types in social networks, predicting the types of chemical molecules and biological proteins, etc.

[0003] Graph classification methods can be divided into graph kernel-based methods and graph neural network (GNNs)-based methods. Graph kernel-based methods calculate the similarity between graphs by counting the number of occurrences of common substructures. Typical methods include: Weisfeiler-Lehman (WL) subtree kernel, GraphletKernel (GK), Deep Graph Kernel (DGK). The WL subtree kernel captures structural similarity by decomposing the graph into subtrees and relabeling the nodes in an iterative manner. DGK uses the dependency information between substructures to improve the representation of graph structure by learning its latent representation. Multi-Scale Shortest Path (MWSP) calculates graph similarity by using multi-scale shortest path node feature graphs and Wasserstein distance to solve the problem of comparison of graphs of different scales and substructure distribution. Other studies use soft permutation matrices to align adjacency matrices and compare them using linear kernels. However, a significant disadvantage of graph kernel-based methods is the separation of feature extraction and downstream classification tasks, so they cannot learn graph features specific to downstream tasks.

[0004] Recently, GNNs have become a powerful tool in the field of graph machine learning. GNNs use local aggregation functions to iteratively learn node representations by aggregating neighborhood information. Classic models include graph convolutional neural networks (GCNs), graph attention networks (GATs), and sampling-based GraphSage. These models aggregate the information of neighboring nodes to central nodes through learnable functions to represent local structures. This approach ignores the various semantic information contained in the graph. In common graph classification methods, a pooling layer is usually added after the convolution layer. A readout operation is performed after each pooling layer, and the readout results of each pooling layer are summarized as the input of a multi-layer perceptron (MLP) for category prediction. However, this type of method has the problem of over-smoothing when adding multiple convolutional layers.

[0005] Through the above analysis, the problems and defects of the existing technology are as follows: traditional graph classification tasks usually describe graph data from a single perspective, ignoring the various semantic information contained in the graph; the algorithm for extracting semantic information by superimposing multiple convolutional layers has the problem of over-smoothing. Summary of the invention

[0006] In view of the problems existing in the prior art, the present invention provides a graph classification system and method combining multiple semantic views and adaptive contrastive learning.

[0007] The present invention is implemented as follows: a graph classification system combining multiple semantic views and adaptive contrastive learning, comprising:

[0008] The multi-semantic view extraction module captures high-order structural features through the WL re-labeling algorithm and word embedding model, and extracts graph features from different semantic views;

[0009] Adaptive contrastive learning module, which retains important node features from multiple semantic views by adaptively generating enhanced graphs and strengthens the relationship between views through contrastive learning across semantic views. Adaptive contrastive learning optimizes the expression of node features through consistency loss;

[0010] The multi-semantic view fusion module uses an attention mechanism to merge node representations from multiple views to distinguish the importance of nodes in different views, thereby generating richer and more comprehensive graph embeddings.

[0011] Furthermore, the multi-semantic view extraction module consists of two main parts: a multi-semantic view construction submodule and an in-view representation learning submodule;

[0012] The multi-semantic view construction submodule specifically includes:

[0013] The WL relabeling algorithm is used to aggregate node labels from different neighborhoods without parameters, and different views are constructed. The representation of nodes in different views is different. Subsequently, the Doc2vec model is used to perform unsupervised learning on the semantic features of nodes in each view, and the PV-DBOW word embedding model is used. The specific steps and formulas are as follows:

[0014] (1) For a given graph dataset, the WL relabeling algorithm is used for L iterations to extract subtrees of different orders in each graph; each iteration generates a subtree pattern corresponding to its order, where the i-th iteration generates the i-th order subtree pattern, as shown in the following formula:

[0015]

[0016] in represents the i-th order subtree pattern with node v as the root, N(v) represents the set of direct neighbors of node v, and the initial subtree pattern is the label of node v, Relabel() is a string hash function, Represents a multiset;

[0017] (2) All i-order subtree patterns extracted from the graph dataset G, the arrangement of the i-order subtree patterns in each graph constitutes the corpus C (i) =(θ (i) ,R (i) ),

[0018]

[0019] where θ (i) is a vocabulary consisting of all the different i-order subtree patterns in the graph dataset, R (i) is the set formed by the i-order subtree patterns in each graph in the dataset, and P() represents the permutation function on the elements of the set;

[0020] (3) Obtain corpus c (i) After that, the present invention is in C (i) Train the Doc2vec model on to obtain (i) The semantic representation of the subtree pattern consists of a feature matrix Here, the jth row represents θ (i) The vector representation of the j-th subtree pattern in , h is the dimension of the subtree pattern vector; it is assumed that each i-order subtree pattern with a node as the root represents the node in the graph and its i-hop local neighborhood; therefore, using the semantic features of the subtree pattern as the features of the corresponding root node, it is possible to generate a specific semantic view of the original graph;

[0021] (4) Finally, different order subtree patterns correspond to different semantic views. Based on the number of WL iterations L, the present invention can construct L different semantic views for g, where the node features of the mth semantic view are represented by H (m) express.

[0022] Furthermore, the in-view representation learning submodule specifically includes:

[0023] Use GCN to capture the graph structure to further learn meaningful representations of node features; configure different sets of weight parameters for GCN in each semantic view to explore its unique features; the node representation H obtained from the mth view (m) As the input of each GCN, the final representation of node features in multiple semantic views is as follows:

[0024]

[0025] in represents the adjacency matrix with self-loops added, represents the diagonal matrix, and W l is the weight matrix of the lth layer in GCN, σ() is the nonlinear activation function,

[0026] Furthermore, the adaptive contrastive learning module generates an enhanced view by integrating information from L different views, identifies important features from the corresponding nodes in these L views, and aggregates them to form an enhanced view representation of the node, ensuring that the enhanced view encapsulates basic information from multiple perspectives and retains important features of nodes in multiple views; the module uses multiple semantic views to adaptively generate an enhanced view and compares it with the L semantic views at the node level; in this comparison, a positive sample is defined as a node at the same position in the enhanced view and the mth semantic view, while all different nodes from different views are regarded as negative samples;

[0027] The multi-semantic view fusion submodule specifically includes:

[0028] Using the node-level adaptive enhancement method, the attention mechanism is used to define the importance score of each node in each view. Based on these scores, a weighted sum is performed on the nodes of the semantic view to generate enhanced nodes. The enhanced graph generated by this method retains the topology and important semantic information of the graph. First, the maximum dimension of the same node in L views is calculated to obtain the intermediate node feature representation b i,j ;

[0029] b i,j =max{H' i,j (1) ,H' i,j (2) ,H' i,j (3) ...H' i,j (L)}, (5)

[0030] Among them, H' i (L) Yes H i (L) Node representations of different views obtained by shared GCN, H' i,j (L) represents the jth bit of the feature of the i-th node in L views, b i,j Indicates that the node features in L views take the maximum value in bitwise order;

[0031] Next, calculate the intermediate node b i The attention coefficient between the nodes in L views. The intermediate node b in the mth view i and node v i The attention coefficient between is calculated as follows:

[0032]

[0033] in, and W are learnable vectors and matrices respectively. Finally, the present invention uses the attention score in Eq (10) to calculate the node features of the enhanced graph, and the node v in the enhanced graph i The representation is as follows:

[0034]

[0035] The Kullback-Leibler (KL) divergence is used to constrain the graphical representation of the enhanced view and multiple views. This uses the entire graph as input to reduce the distribution gap between the enhanced view and each view; first, by considering the entire graph, the present invention captures the dependency between the enhanced view and each view, thereby improving the accuracy of the learned representation; second, the KL divergence is applied to constrain the view to promote regularization, and the calculation formula of the KL divergence is as follows:

[0036]

[0037] Where p(K i ) indicates v i The distribution probability in the enhanced graph, p(H i (m) ) indicates v i The probability distribution in each view is obtained by applying a softmax function to the graph embedding.

[0038] Furthermore, the graph contrast learning submodule specifically includes:

[0039] Different views and enhanced views are fed into the shared GCN to obtain H’ i (m) and K' i In order to transform the original embedding into a more effective and discriminative representation, the embedding after GCN is input into the projection head That is, a two-layer MLP. The formula is as follows:

[0040]

[0041] F i =σ(W 2 σ(W 1 K' i +b 1 )+b 2 ), (10)

[0042] Where W 1 , b 1 , σ is the activation function. Next, the present invention utilizes node-level contrastive learning;

[0043]

[0044] When τ is the temperature parameter, we define the similarity θ between samples (B (m) ,F), where θ(.) represents the inner product. The positive sample corresponds to the first term in the denominator, while the negative sample corresponds to the second and third terms in the denominator. Since the comparison between positive and negative samples is symmetrical, the definition of the loss of another view is similar to Equation 11. The specific formula of the contrast loss is as follows:

[0045]

[0046] In summary, in the contrastive learning module, we first generate adaptive graph enhancements based on multiple semantic views, and then update node features through a loss function.

[0047] Furthermore, the multi-semantic view fusion module uses a fusion method to combine multiple semantic views and enhanced views through an attention mechanism; the view attention model is used to adaptively learn the importance of nodes in different views, and the node information in all views is weightedly fused to obtain the fused node v i Embedding; for node v in the mth view i , its characteristics can be expressed as The attention value is calculated as follows:

[0048]

[0049] in, is the learnable weight matrix, is the bias vector. Weight The larger the value, the more important the corresponding view is for the final node representation. Therefore, the final node representation after fusion of multiple semantic views can be expressed as:

[0050]

[0051] Furthermore, the optimization objectives specifically include:

[0052] To perform graph classification tasks, the graph representation Z is obtained by applying the readout function to the fused node representations, and then Z is fed into the MLP layer to predict the graph label. The loss function is defined as the cross entropy of the label prediction:

[0053]

[0054]

[0055] In the formula, p is the number of categories in the graph, G i The predicted probability of belonging to class j, y ij is the true label;

[0056] Then the image classification loss, contrast loss, and visual Figure 1 Consistency losses are combined into an overall loss:

[0057] L total =αL c +βL Ic +γL con , (17)

[0058] The goal is to minimize L during training. total , α, β, γ are learnable parameters used to control the contribution of each loss, and finally the optimizer is used to optimize L total Perform optimization and update model parameters.

[0059] Another object of the present invention is to provide a graph classification method for joint multiple semantic views and adaptive contrastive learning that realizes the graph classification system for joint multiple semantic views and adaptive contrastive learning, comprising:

[0060] S1, captures high-order structural features through the WL re-labeling algorithm and word embedding model, and extracts graph features from different semantic views;

[0061] S2, retains important node features from multiple semantic views by adaptively generating enhanced graphs, and strengthens the relationship between views through contrastive learning across semantic views. Adaptive contrastive learning optimizes the expression of node features through consistency loss;

[0062] S3, uses an attention mechanism to merge node representations from multiple views to distinguish the importance of nodes in different views, thereby generating richer and more comprehensive graph embeddings.

[0063] Another object of the present invention is to provide a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the graph classification method of joint multi-semantic views and adaptive contrast learning.

[0064] Another object of the present invention is to provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to perform the steps of the graph classification method of joint multi-semantic views and adaptive contrast learning.

[0065] Another object of the present invention is to provide an information data processing terminal, which includes the graph classification system of joint multi-semantic views and adaptive contrast learning.

[0066] In combination with the above technical solutions and the technical problems solved, the advantages and positive effects of the technical solutions to be protected by the present invention are as follows:

[0067] First, in view of the technical problems existing in the above-mentioned prior art, some creative technical effects are brought about after solving the problems. The specific description is as follows:

[0068] (1) This paper proposes a multi-semantic view extraction module. This module uses the WL re-labeling algorithm and word embedding model to extract graph features from different views, capture high-order structural features, and alleviate the over-smoothing problem inherent in traditional graph neural networks.

[0069] (2) This paper proposes an adaptive contrastive learning method across multiple semantic views. This method enriches the node feature representation and further alleviates the over-smoothing problem.

[0070] (3) The effectiveness of the proposed method is verified through extensive experiments, in which the graph classification accuracy on different datasets is improved by 6% on average.

[0071] Second, the present invention proposes a multi-semantic view graph classification algorithm, the purpose of which is to extract high-order semantic information from the graph while alleviating the smoothing problem. Specifically, the present invention uses the WL subtree pattern and the word embedding model to extract semantic information of different granularities. Then, the present invention introduces cross-view contrastive learning to enhance the relationship between views and further alleviate the smoothing problem. Finally, the attention mechanism is used to fuse multiple semantic views. The experimental results of 5 datasets show that the method of the present invention outperforms the SOTA classification method. Future research directions may explore the use of technologies such as generative adversarial networks (GANs) to further enhance the performance and robustness of multi-semantic graph classification algorithms, especially for classifying dynamic graph data in real-world applications.

[0072] Third, the expected benefits and commercial value of the technical solution of the present invention after transformation are:

[0073] A. Improved technical competitiveness: The technical solution of the present invention improves the performance of graph classification through innovative multi-semantic views and adaptive contrast learning methods, thereby enhancing the market competitiveness of the technical solution. B. Expansion of application fields: Due to the improved accuracy of graph classification and the robustness of the model, the technical solution of the present invention can be applied to more fields, such as medical diagnosis, financial risk assessment, intelligent manufacturing, etc., bringing new business opportunities to enterprises. C. Improved data processing efficiency: By optimizing the processing method of graph data, the technical solution of the present invention can improve the efficiency of data processing, reduce the consumption of computing resources, and thus reduce the operating costs of enterprises. D. Expansion of business partners: The technical solution of the present invention can attract more business partners, such as research institutions, start-ups, etc., to jointly develop and promote related products and services. E. Cooperation opportunities and intellectual property benefits: The innovation and advancement of this technical solution will attract the attention of other enterprises and research institutions, and bring cooperation opportunities to enterprises, such as technology licensing, technology transfer, etc. Through these cooperations, enterprises can obtain additional intellectual property benefits, such as patent licensing fees, technology transfer fees, etc.

[0074] The technical solution of the present invention fills the technical gap in the industry at home and abroad:

[0075] A. Technical novelty: The technical solution of the present invention proposes a graph classification framework based on multiple semantic views and adaptive contrastive learning, which is a brand-new method. In previous domestic and foreign literature or patents, no similar technical solution has been clearly proposed or applied. This solution not only takes into account the various semantic information in the graph, but also effectively alleviates the over-smoothing problem of graph embedding through the adaptive contrastive learning module. This innovative combination and application has significant novelty.

[0076] B. Practicality of the technology: The technical solution of the present invention aims to solve the long-standing problem in the field of graph neural networks, namely how to simultaneously capture multiple semantic information of graph data and avoid over-smoothing of the model. Through the design of multiple semantic views and adaptive contrast learning modules, the technical solution can significantly improve the accuracy of tasks such as graph classification. This technology not only meets the demand for efficient and accurate graph data processing technology, but also provides a practical solution for the industry, which has significant practicality.

[0077] C. Technical advancement: Compared with traditional graph neural network methods, the technical solution of the present invention shows significant advancement in many aspects. First, the design of multiple semantic views enables the technology to more comprehensively capture the complex structure and semantic information in the graph; second, the adaptive contrast learning module effectively alleviates the over-smoothing problem and improves the performance of the model; finally, the technical solution has achieved excellent classification performance on multiple data sets, significantly better than the existing technology. These advantages all demonstrate the technical advancement of the technical solution.

[0078] In summary, the technical solution of the present invention has outstanding performance in terms of novelty, practicality and advancement, filling the technical gap in the industry at home and abroad. By proposing a graph classification framework with multiple semantic views and adaptive contrast learning, this technology provides new ideas and methods for the research and application of graph neural networks, which has important theoretical and practical significance.

[0079] The technical solution of the present invention solves the technical problems that people have been eager to solve but have never been able to solve successfully:

[0080] Some graph neural networks ignore multi-semantic information and have over-smoothing problems when processing graph data. The above problems have always been a hot topic and difficulty in this field. This paper successfully solves these problems and improves the accuracy of graph classification by introducing multi-semantic views and adaptive contrast learning. This achievement not only meets people's demand for more accurate and effective graph data processing methods, but also provides a new direction for research in the field of graph neural networks.

[0081] The technical solution of the present invention overcomes technical prejudice:

[0082] The technical solution of the present invention overcomes technical bias to a certain extent. A. Breaking through traditional single-perspective processing: Traditional graph neural networks usually understand graph data from a single view, which ignores the various semantic information contained in the graph. The present invention proposes a graph classification framework based on multiple semantic views, which overcomes this technical bias and constructs multiple semantic views by extracting semantic features in different neighborhoods of each node, thereby capturing the complex structure and semantic information in the graph more comprehensively and accurately. B. Solving the over-smoothing problem: In traditional graph neural networks, with the increase of convolutional layers, graph embedding often has an over-smoothing problem, that is, the node representations tend to be consistent, resulting in information loss. The present invention not only enhances the relationship between views by introducing an adaptive contrast learning module, but also effectively alleviates the over-smoothing problem. This innovative method breaks the inherent bias against the over-smoothing problem in traditional graph neural networks. C. Significantly improve performance: The present invention is not only innovative in theory, but also has achieved significant performance improvements in practice. Through a large number of experiments, the present invention has achieved high classification performance on multiple data sets. Compared with the most advanced SOTA methods, it has achieved 5.6%, 3.6%, 6.4%, 13.2% and 9.5% improvements on NCI1, NCI109, PTC, ENZYMES and PROTEINS data sets respectively. These experimental results fully demonstrate the effectiveness of the technical solution of the present invention and further verify its ability to overcome technical bias.

[0083] Fourth, the present invention proposes a graph classification system that combines multiple semantic views and adaptive contrastive learning to address the problems of low accuracy, poor training efficiency, and insufficient fusion of multi-view features in existing graph classification technologies. When processing graph structure data, existing technologies often rely only on a single view and ignore the multi-semantic features of the graph, resulting in low classification accuracy. In addition, when processing complex graph structures and multi-view data, traditional graph classification methods cannot effectively capture important feature relationships between different views, resulting in poor training efficiency and poor model performance.

[0084] Fifth, the present invention proposes a new system architecture and algorithm to address the problems of insufficient single-view features, low efficiency of contrastive learning, and insufficient feature fusion in existing graph classification technologies. In the prior art, since the feature extraction method only relies on a single view, it is easy to ignore the multi-semantic features of the graph, resulting in low classification accuracy. In addition, when processing multi-view data, traditional contrastive learning methods are difficult to effectively capture and retain key node features, affecting the overall performance of the model.

[0085] This paper proposes a series of new parameters and algorithms through modules such as multi-semantic view extraction, adaptive contrastive learning and multi-view fusion. Specifically, it uses the WL re-labeling algorithm and Doc2vec model to extract high-order structural features, uses the adaptive contrastive learning module to generate enhanced graphs and perform contrastive learning across semantic views, and performs multi-view fusion through the attention mechanism. In particular, the parameters α, β, γ, μ The introduction and optimization of the model effectively improved the accuracy and training efficiency of the model.

[0086] The present invention ensures fine-grained feature extraction and solves the over-smoothing problem by constructing a multi-semantic view model. In addition, adaptive contrast learning is used to distinguish nodes from surrounding nodes, thereby further solving the over-smoothing problem.

[0087] The present invention significantly improves the accuracy and training efficiency of graph classification, and represents an important technical advancement. Through technical means such as multi-semantic view extraction, adaptive contrastive learning, and multi-view fusion, the present invention can comprehensively capture the multi-semantic features of the graph, and retain important features and optimize feature expression through adaptive enhancement of the graph and contrastive learning. Compared with traditional methods, the present invention has significantly improved classification accuracy and efficiency, has a wide range of practical application value, promotes the development of graph classification technology, and provides a new solution for the analysis and processing of complex graph data. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0089] Figure 1 The graph classification method of combining multiple semantic views and adaptive contrast learning provided by the embodiment of the present invention is

[0090] Figure 2 The graph classification method of combining multiple semantic views and adaptive contrast learning provided by the embodiment of the present invention is

[0091] Figure 3 It is a schematic diagram of the framework of the MVACL model provided by an embodiment of the present invention;

[0092] Figure 4 is a schematic diagram of setting positive and negative sample pairs provided by an embodiment of the present invention;

[0093] Figure 5 It is a schematic diagram of graph classification accuracy under different subtree orders and feature dimensions provided by an embodiment of the present invention;

[0094] Figure 6 It is a schematic diagram of experimental results provided by an embodiment of the present invention;

[0095] Figure 7 It is a schematic diagram of comparing GCN and MVACL with different numbers of convolutional layers provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0096] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0097] In view of the problems existing in the prior art, the present invention provides a graph classification system and method combining multiple semantic views and adaptive contrastive learning. The present invention is described in detail below with reference to the accompanying drawings.

[0098] like Figure 1 As shown, the graph classification system combining multiple semantic views and adaptive contrastive learning provided by the embodiment of the present invention includes:

[0099] The multi-semantic view extraction module captures high-order structural features through the WL re-labeling algorithm and word embedding model, and extracts graph features from different semantic views;

[0100] Adaptive contrastive learning module, which retains important node features from multiple semantic views by adaptively generating enhanced graphs and strengthens the relationship between views through contrastive learning across semantic views. Adaptive contrastive learning optimizes the expression of node features through consistency loss;

[0101] The multi-semantic view fusion module uses an attention mechanism to merge node representations from multiple views to distinguish the importance of nodes in different views, thereby generating richer and more comprehensive graph embeddings.

[0102] like Figure 2 As shown, the graph classification method combining multiple semantic views and adaptive contrast learning provided by the embodiment of the present invention includes:

[0103] S1, captures high-order structural features through the WL re-labeling algorithm and word embedding model, and extracts graph features from different semantic views;

[0104] S2, retains important node features from multiple semantic views by adaptively generating enhanced graphs, and strengthens the relationship between views through contrastive learning across semantic views. Adaptive contrastive learning optimizes the expression of node features through consistency loss;

[0105] S3, uses an attention mechanism to merge node representations from multiple views to distinguish the importance of nodes in different views, thereby generating richer and more comprehensive graph embeddings.

[0106] GNNs have shown excellent results in graph representation learning. Gilmer et al. proposed a message passing neural network (MPNN) framework to update the representation of the central node by iteratively aggregating neighbor features and pass the updated representation to a readout function for graph-level classification tasks. However, traditional MPNN methods face the challenge of distinguishing non-isomorphic graphs. To address this problem, the graph isomorphic network (GIN) introduces a multi-layer structure with permutation invariance and scalability, which effectively solves the graph isomorphism problem. Traditional graph neural networks require all nodes in the graph to exist during embedding training and cannot be naturally generalized to unseen nodes. To address this challenge, GraphSage proposed an inductive method to generate representations of unseen nodes by aggregating neighbor information in a fixed-size neighborhood. In addition, GAT assumes that different neighboring nodes contribute differently to the central node and uses an attention mechanism to learn the relative weights between two nodes to capture the relationship between nodes. Recently, some progress has been made in graph classification tasks based on GNNs. MAC introduces a pooling method that uses multiple strategies to evaluate the importance of nodes and updates node representations through an attention mechanism. SAGAT exploits the interactions between the substructures of the graph to learn high-order representations of the graph. DKEPool considers both graph topology learning and node distribution learning in the pooling layer. The former uses a recursive neighborhood aggregation scheme to extract graph structure information, while the latter focuses on the distribution presented by all nodes. PAS introduces a method to automatically learn data-specific pooling architectures in GNN-based graph classification, adopting a unified pooling framework that includes aggregation, pooling, and readout. DMIPool uses a dual-view framework and multi-level maximization of mutual information to optimize the quality of node-level and graph-level representations. OMG improves model generalization by combining graph contrastive learning with Mixup to solve the label noise problem in graph classification. Despite these advances, existing methods still rely on stacking multiple graph convolutional layers to extract features, which may lead to over-smoothing of graph embeddings. Over-smoothing limits the model's ability to capture graph features, which in turn affects classification performance.

[0107] Recently, graph contrastive learning (GCL) methods have been designed for unsupervised learning of nodes or graphs and have achieved SOTA performance. GCL methods can be divided into two categories according to the method of generating enhanced views. The first category focuses on generating views by exploiting substructures at different scales. For example, GCA generates structure and attribute views for contrastive learning. At the topological level, GCA designs a scheme based on node centrality measurement to emphasize important connection structures; at the attribute level, it introduces more noise to destroy less important node features. Chen et al. considered three different views: original view, attribute view, and global structure view, and extracted rich graph embedding information from these three views through joint contrastive learning. GraphCL proposed a GNNs pre-training framework by designing four types of graph data augmentation to obtain relevant views. The SUGAR framework proposed by Sun et al. adopts an enhanced pooling mechanism to adaptively select important subgraphs. In addition, the self-supervised mutual information mechanism encourages subgraph representations to preserve global properties by maximizing the mutual information between local and global graph representations. The second category generates views through graph augmentation techniques, which mainly focus on operations on nodes or edges in the graph. Zhu et al. generated two enhanced views of the graph by randomly discarding edges and masking node features. Autogcl uses a set of learnable view generators to dynamically generate contrast samples through an automatic augmentation strategy. This preserves the representative structure of the original graph while introducing augmented changes through a learning strategy. AGCL uses GCN filters and diffusion-based filters to smooth the initial node features and obtain two node embeddings representing local and global views. Sun et al. obtain graph representations by maximizing the mutual information between graph-level representations and block-level representations. Kaveh et al. generate augmented views by transforming the adjacency matrix into a diffusion matrix. IGCL generates augmented views by reconstructing the graph topology using augmentations in the latent space learned from a variational graph autoencoder.

[0108] The method proposed in the present invention generates an enhanced view based on L different views, wherein the most significant features of the same node are retained to generate the enhanced view. By retaining the key features of nodes across different views, the present invention can capture the diversity and complexity of the graph.

[0109] Multi-view learning aims to process and integrate information from features of multiple views and is commonly used in fields such as computer vision and natural language processing. Multi-view learning extracts consistent and complementary information from different views to enhance the robustness and comprehensiveness of features. GARDNet integrates multi-view methods through three different convolutional neural networks, which process images of original size, cropped disc areas in the preprocessing step, and images converted to polar coordinates respectively. Each view is trained separately, and the final classification prediction is obtained by the weighted average of the three softmax predictions. In the multi-view feature fusion framework, features are extracted from two different views, the original image and the remote sensing image, and then the classifier is trained using the support set features, and the fusion weights are calculated. The nuclear norm-based optimization method performs multi-view image data fusion through a joint learning framework.

[0110] In computer vision, image pyramid is a multi-scale representation method that generates copies of images at different resolutions, with features at different scales having different semantic meanings. The work of this invention is inspired by this model, and similarly, different views are generated by extracting high-order neighbor information of different granularities of the same node. Inspired by existing methods, the work of this invention adopts the concept of multi-view learning in graph convolutional networks, generating different views and allowing the integration of information from different angles. These methods help to extract graph embeddings from various views, enrich the representation of graph structures, and provide greater possibilities for further analysis of graph data.

[0111] This paper provides a detailed explanation of the proposed framework. The overall framework of MVACL is as follows Figure 3 As shown in the figure, the framework consists of three modules: (1) Multi-semantic view extraction module. This module captures high-order structural features through the WL re-labeling algorithm and word embedding model, and extracts graph features from different semantic views. (2) Adaptive contrastive learning module. This module retains important node features from multiple semantic views by adaptively generating enhanced graphs, and strengthens the relationship between views through contrastive learning across semantic views. Adaptive contrastive learning optimizes the expression of node features through consistency loss. (3) Multi-semantic view fusion module. This module uses the attention mechanism to merge node representations from multiple views to distinguish the importance of nodes in different views, thereby generating richer and more comprehensive graph embeddings.

[0112] The present invention introduces the problem definitions of the multi-semantic view extraction module, the adaptive contrast learning module and the view fusion module. For convenience, Table 1 lists the definitions of some important symbols.

[0113] Table 1 Symbol Definition

[0114]

[0115]

[0116] The multi-semantic view extraction module consists of two main parts: a multi-semantic view construction module and an in-view representation learning module.

[0117] The convolution operator in the MPNN framework aggregates node features by propagating information from adjacent nodes to the central node. Although the node feature aggregation process is similar to the WL relabeling algorithm, the accumulation of parameters in multiple aggregations will lead to the over-smoothing problem of graph embedding, which in turn affects the performance of downstream tasks. In order to solve this problem, the present invention adopts the WL relabeling algorithm to aggregate node labels from different neighborhoods without parameters and construct different views. The representation of nodes in different views is different. Subsequently, the present invention uses the Doc2vec model to perform unsupervised learning on the semantic features of nodes in each view. Specifically, this paper adopts the PV-DBOW word embedding model. The specific steps and formulas are as follows:

[0118] (5) For a given graph data set, the present invention uses the WL relabeling algorithm to perform L iterations to extract subtrees of different orders in each graph. Each iteration will generate a subtree pattern corresponding to its order, where the i-th iteration generates the i-th order subtree pattern. The formula is as follows:

[0119]

[0120] in represents the i-th order subtree pattern with node v as the root, N(v) represents the set of direct neighbors of node v, and the initial subtree pattern is the label of node v, Relabel() is a string hash function, Represents a multiset.

[0121] (6) All i-order subtree patterns extracted from the graph dataset G, the arrangement of the i-order subtree patterns in each graph constitutes the corpus C (i) =(θ (i) ,R (i) ),

[0122]

[0123] where θ (i) is a vocabulary consisting of all the different i-order subtree patterns in the graph dataset, R (i) It is a set formed by the i-order subtree patterns in each graph in the dataset, and P() represents the permutation function on the elements of the set.

[0124] (7) Obtain corpus C (i) After that, the present invention is in C (i) Train the Doc2vec model on to obtain (i)The semantic representation of the subtree pattern consists of a feature matrix Here, the jth row represents θ (i) The vector representation of the jth subtree pattern in , h is the dimension of the subtree pattern vector. It is assumed that each i-order subtree pattern with a node as the root represents the node in the graph and its i-hop local neighborhood. Therefore, using the semantic features of the subtree pattern as the features of the corresponding root node, it is possible to generate a specific semantic view of the original graph.

[0125] (8) Finally, different order subtree patterns correspond to different semantic views. Based on the number of WL iterations L, the present invention can construct L different semantic views for g, where the node features of the mth semantic view are represented by H (m) express.

[0126] In-view representation learning: In this module, we use GCN to capture the graph structure to further learn meaningful representations of node features. GCN is configured with different sets of weight parameters in each semantic view to explore its unique features. The node representation H obtained from the mth view (m) As the input of each GCN, the final representation of node features in multiple semantic views is as follows:

[0127]

[0128] in represents the adjacency matrix with self-loops added, represents the diagonal matrix, and W l is the weight matrix of the lth layer in GCN, σ() is the nonlinear activation function,

[0129] Adaptive contrastive learning module: The method proposed in the present invention generates an enhanced view by integrating information from L different views. Specifically, the present invention identifies important features from the corresponding nodes in these L views and aggregates them to form an enhanced view representation of the node. This process ensures that the enhanced view encapsulates basic information from multiple perspectives and retains important features of nodes in multiple views. This module adaptively generates an enhanced view using multiple semantic views and compares it with L semantic views at the node level. In this comparison, positive samples are defined as nodes at the same position in the enhanced view and the mth semantic view, while all different nodes from different views are considered negative samples. An illustration of the positive and negative sample pairs is shown in Figure 4 shown.

[0130] Multi-semantic view fusion module: Since simply deleting nodes or edges in the graph structure can easily destroy the structural information of the graph, this paper uses a node-level adaptive enhancement method. The attention mechanism is used to define the importance score of each node in each view. Based on these scores, a weighted sum is performed on the nodes of the semantic view to generate enhanced nodes. The enhanced graph generated by this method retains the topology and important semantic information of the graph. First, the present invention calculates the maximum dimension of the same node in L views to obtain the intermediate node feature representation b i,j .

[0131] b i,j =max{H' i,j (1) ,H' i,j (2) ,H' i,j (3) ...H' i,j (L)}, (5)

[0132] Among them, H' i (L) Yes H i (L) Node representations of different views obtained through shared GCN. H' i,j (L) represents the jth bit of the feature of the i-th node in L views, b i,j Indicates that the node features in L views take the maximum value bit by bit.

[0133] Next, calculate the intermediate node b i The attention coefficient between the nodes in L views. The intermediate node b in the mth view i and node v i The attention coefficient between is calculated as follows:

[0134]

[0135] in, and W are learnable vectors and matrices respectively. Finally, the present invention uses the attention score in Eq (6) to calculate the node features of the enhanced graph. i The representation is as follows:

[0136]

[0137] The present invention uses Kullback-Leibler (KL) divergence to constrain the graphical representation of the enhanced view and multiple views. This uses the entire graph as input to reduce the distribution gap between the enhanced view and each view. First, by considering the entire graph, the present invention captures the dependencies between the enhanced view and each view, thereby improving the accuracy of the learned representation. Second, applying KL divergence to constrain the view promotes regularization. The calculation formula of KL divergence is as follows:

[0138]

[0139] Where p(K i ) indicates v i The distribution probability in the enhanced graph, p(H i (m) ) indicates v i The probability distribution in each view. We obtain the probability distribution by applying a softmax function to the graph embedding.

[0140] Graph Contrastive Learning: GCL learns the embeddings of nodes or subgraphs by contrasting positive and negative pairs in graph data. This process encourages the embeddings of positive pairs or subgraphs to cluster closely together, while pushing negative pairs or subgraphs farther apart in the embedding space. The present invention designs multiple semantic view node-level contrastive learning to ensure that the feature representation of each node is dissimilar to that of its neighbors. Specifically, each node in the augmented graph is regarded as an anchor point. A positive pair is defined as follows: an anchor point in the augmented view and a node occupying the same position in each view. Negative pairs have two sources: all different nodes within a view and from different views are regarded as negative samples. Figure 2 In the figure, positive sample pairs are represented by red dashed lines, and negative sample pairs are represented by blue and green dashed lines. This method not only enriches the graph information obtained by the enhanced nodes, but also alleviates the over-smoothing problem caused by the enhanced nodes. The similarity between nodes is determined by setting negative sample pairs. Different views and enhanced views are fed into the shared GCN to obtain H' i (m) and K' i In order to transform the original embedding into a more effective and discriminative representation, the present invention inputs the embedding after GCN into the projection head That is, a two-layer MLP. The formula is as follows:

[0141]

[0142] Where W 1 , b 1 , v is an activation function. Next, the present invention utilizes node-level contrastive learning.

[0143]

[0144] When τ is the temperature parameter, we define the similarity between samples, where represents the inner product. Positive samples correspond to the first term in the denominator, while negative samples correspond to the second and third terms in the denominator. Since the comparison between positive and negative samples is symmetrical, the definition of the loss of another view is similar to Equation 11. The specific formula of the contrast loss is as follows:

[0145]

[0146] In summary, in the contrastive learning module, we first generate adaptive graph enhancements based on multiple semantic views, and then update node features through a loss function.

[0147] Multi-semantic view fusion module: Integrating multiple semantic views into a unified representation is crucial to facilitating downstream graph classification tasks. Changes in the local neighborhood structure between nodes lead to differences in node importance under different perspectives. Therefore, it is necessary to filter out noise and retain task-related features. After obtaining node representations from multiple semantic views, the goal of the present invention is to further enhance the feature extraction capability of the network. To achieve this goal, the present invention uses a fusion method to combine multiple semantic views and enhanced views through an attention mechanism. The view attention model is used to adaptively learn the importance of nodes in different views, and the node information in all views is weightedly fused to obtain a fused node v i Embedding. Specifically, for the node v in the mth view i , its characteristics can be expressed as The attention value is calculated as follows:

[0148]

[0149] in, is the learnable weight matrix, is the bias vector. Weight The larger the value, the more important the corresponding view is for the final node representation. Therefore, the final node representation after fusion of multiple semantic views can be expressed as:

[0150]

[0151] 2.5 Optimization Objectives

[0152] To perform graph classification tasks, we obtain a graph representation Z by applying a readout function to the fused node representations, and then feed Z to the MLP layer to predict graph labels. The loss function is defined as the cross entropy of label prediction:

[0153]

[0154]

[0155] In the formula, p is the number of categories in the graph, G i The predicted probability of belonging to class j, y ij is the true label.

[0156] Then the present invention combines the image classification loss, contrast loss, and visual Figure 1 Consistency losses are combined into an overall loss:

[0157] L total =αL c +βL Ic +γL con , (17)

[0158] The goal of the present invention is to minimize L during the training process. total , α, β, γ are learnable parameters used to control the contribution of each loss. Finally, the present invention uses an optimizer to total Perform optimization and update model parameters.

[0159] Experimental details and quantitative evaluation of the proposed MVACL model. The experiments were performed on datasets containing chemical molecules, biological networks, and social networks. The baselines for comparison included graph kernels, GNN methods, and contrastive learning methods. Subsequently, ablation studies were performed to verify the contribution of each module within the MVACL framework. Sensitivity analysis of hyperparameters was performed to explore their impact on model performance.

[0160] The present invention uses 6 public and benchmark datasets, including molecular datasets (NCI1, NCI109 and PTC), bioinformatics datasets (PROTEINS and ENZYMES) and social network datasets (IMDB-BIN). NCI1 and NCI109 are two medium-sized biological datasets for anticancer activity classification. The labels of the graphs indicate whether they can inhibit the growth of cancer cells. PTC-MR is a binary dataset containing 344 molecules, which marks the carcinogenicity of these compounds to male rats. PROTEINS is a protein collection where nodes are secondary structural elements. If two nodes are adjacent in the amino acid sequence or in 3D space, there is an edge between them. ENZYMES consists of 600 protein tertiary structures from the BRENDA enzyme database, and each enzyme belongs to one of the 6 EC top categories. IMDB-BIN is a movie collaboration dataset that collects actor and genre information from different movies on IMDB. For each graph, the nodes represent actors / actresses, and if they appear in the same movie, there is an edge between them. Table 2 shows the statistics of each dataset.

[0161] Table 2 Dataset statistics

[0162]

[0163] Comparison algorithms:

[0164] (1) Graph kernel method: This paper selects three representative graph kernel methods for comparative experiments: WL, GK, DGK and MWSP for comparative experiments. (2) Graph neural network method: GCN, GAT, GraphSage and SA-GAT are selected mainly for learning node-level representations. This paper uses a readout function that generates a graph representation to perform graph classification tasks. The readout functions mentioned in this article are all average pooling. (3) Graph comparative learning method: This group of methods focuses on completing graph classification tasks through comparative learning. This paper selects several representative algorithms as baselines: SUGAR, InfoGraph, GraphCL, LCGNN, iGCL, AutoGCL and DMIPool. The above baseline methods are all mentioned in related work.

[0165] The present invention uses 10-fold cross validation to obtain the mean and standard deviation. For each data set, a specific set of hyperparameters is selected to optimize the model performance. In addition, a maximum limit is imposed on the number of training epochs to prevent overfitting and promote convergence. An early stopping mechanism is used to ensure the best hyperparameter selection. If there is no significant reduction in training loss for 20 consecutive epochs, the training stops. Each experiment is repeated 10 times to ensure the robustness and reliability of the experimental results. Finally, the classification accuracy and standard error are provided.

[0166] In this section, we compare the above six datasets. Table 2 shows the comparison results between the proposed MVACL and the graph kernel baseline, GNN baseline, and contrastive learning baseline. The best results are highlighted in bold (“-” indicates that there is no data available in the original paper).

[0167] Table 3 Graph classification accuracy of six types of data

[0168]

[0169]

[0170] Experimental results show that the proposed method achieves the best graph classification accuracy on 5 out of 6 test datasets compared with other methods. However, due to the lack of labels, the IMDB-BIN data may not achieve the expected results in the subtree mode iteration stage. SUGAR and DMIPool are most related to the model of the present invention. Compared with the SUGAR model, the accuracy on the NCI1, NCI109, PTC and PROTEINS datasets is improved by 5.6%, 3.6%, 6.4% and 9.5%, respectively. Compared with the DMIPool model, the accuracy on the NCI1, NCI109, ENZYMES and PROTEINS datasets is improved by 5.7%, 5.7%, 13.2% and 12.3%, respectively. SUGAR uses classification loss and contrastive loss to update node features. However, contrastive learning using only extracted subgraphs and negative samples may not make full use of global information. DMIPool generates an adaptive enhanced graph by removing less important edges and designs a dynamic fusion mechanism to integrate feature information and topological information. Finally, a cross-view multi-level mutual information method is proposed to optimize node-level and graph-level representations. However, this method obtains node representations from smaller inductive subgraphs and limits its ability to capture global node information. In contrast, the method of the present invention first aggregates multi-order neighbor information through multiple semantic view extraction modules. It can extract information of different granularities. Subsequently, an adaptive contrastive learning module is used to dynamically optimize node representations and strengthen connections between views.

[0171] In the present invention, the present invention conducts ablation experiments. The present invention has implemented the following variants of MVACL: (1) MVACL-Con-IC means removing contrastive learning and visual Figure 1 (2) MVACL-IC represents the model of the consistency module based on the model of the present invention. Figure 1 Table 4 provides the results of different model variants. The results show that MVACL achieves better performance than MVACL-Con-IC and MVACL-IC on all 6 datasets. The collaboration of multiple semantic views and adaptive contrastive learning shows advantages in improving model performance. At the same time, MVACL-IC surpasses MVACL-Con-IC, indicating that using contrastive learning as an auxiliary task helps to optimize node representation and significantly improves the accuracy of graph classification. In addition, MVACL outperforms MVACL-IC, which shows that the consistency learning framework helps to enhance the model and produces superior performance.

[0172] Table 4 Ablation experiment

[0173]

[0174] In order to analyze the performance of MVACL in terms of subtree hops and feature dimensions, the present invention calculates the average classification accuracy of 10 10-fold cross validations for various combinations of subtree hops and feature dimensions. The subtree hop selection range is [1,10], and the feature dimension selection range is {50,100,150,200,250}. In general, selecting a larger subtree hop number on a large dataset can more comprehensively capture local and global information structures. In contrast, small datasets usually select a smaller subtree hop number to avoid overfitting. However, the PTC and EMZYMES datasets have simple graph structures and node relationships, so selecting a larger subtree hop number helps capture information in their simple structures. In terms of feature dimension selection, high-dimensional features can provide richer feature representations for large datasets with complex structures. In contrast, lower dimensions are sufficient to describe simple structures in smaller datasets. Although ENZYMES only contains 600 graphs, its nodes have complex relationships, so high-dimensional features are adopted. The experimental results are shown in Figure 2. Figure 5 As shown. Combined with the figure, the choices made by the present invention in the experiment are as follows: under the 250-dimensional NCI1, select 6-hop to 8-hop fusion; under the 250-dimensional NCI109, select 7-hop to 9-hop fusion; under the 50-dimensional PTC, select from 8 hops to 10 hops; under the 200-dimensional PROTEINS, select from 8 hops to 10 hops; under the 250-dimensional ENZYMES, select from 3 hops to 5 hops; under the 50-dimensional IMDB-BIN, select from 6 hops to 8 hops. The selection of subtrees in different orders is intended to utilize the structural information of the graph dataset to avoid overfitting or underfitting. The present invention further studies the effects of batch size, hidden layer dimension (Hidden-dim) and learning rate on graph classification accuracy. The hidden layer dimension selection range is {32, 64, 128}, and the learning rate selection range is {10 -5 , 10 -4 , 10 -3 , 10 -2}, the batch size selection range is {8, 16, 32, 64}. Figure 6 6(a), 6(b) and 6(c). MVACL achieves different optimal parameter configurations on various datasets. Specifically, on the NCI1, ENZYMES and IMDB-BIN datasets, the present invention selects 64 as the optimal hidden layer dimension. For the PTC, NCI1 and ENZYMES datasets, the present invention selects 10 -4 As the best learning rate, on the IMDB-BIN dataset, 10 -5 As the optimal learning rate. In addition, on the PTC and IMDB-BIN datasets, the present invention selects 32 as the optimal batch size, and on the NCI1 and ENZYMES datasets, selects 16 as the optimal batch size.

[0175] This paper compares the classification accuracy between multi-semantic view and single-semantic view methods. The best single-semantic view results are selected for different datasets. Figure 1 ", "monosemantic view Figure 2 ” and “monosemantic view Figure 3 " indicates different semantic views used. Multiple semantic views are semantic views. Figure 1 , 2 The experimental results show that the accuracy achieved by the method using multiple semantic views is always better than that of using a single view alone, as shown in Table 5. Specifically, the integration of different views provides the model with richer and more comprehensive graph structure information, thereby improving the classification performance.

[0176] Table 5 Comparison of image classification accuracy between multiple semantic views and single semantic view

[0177]

[0178] 3.8 Effectiveness of MVACL in Alleviating Oversmoothing Problem

[0179] In order to verify the effectiveness of the method of the present invention, the present invention stacks different graph convolutional layers onto multiple semantic view extraction modules. Figure 7 As shown, the present invention also stacked multiple layers on GCN and measured the final classification accuracy of the two methods. For fair comparison, GCN adopted the same pooling method as the MVACL framework, namely global average pooling, and trained for the same number of epochs. Experimental results on the PTC, PROTEINS, NCI1 and IMDBBIN datasets show that GCN performs well with fewer convolutional layers. However, as the number of convolutional layers increases, its performance shows a downward trend. This is due to the over-smoothing problem in GCN, where node features quickly converge to similar values ​​as the number of layers increases. This limitation limits the depth of GCN. On the contrary, within the MVACL framework, the present invention observed that the accuracy of PROTEINS, NCI1 and PTC increased with the increase in the number of convolutional layers. The accuracy in the IMDB-BIN dataset decreased slightly. In general, the results of the present invention show that the model better retains node differences and alleviates the problem of over-smoothing.

[0180] An application embodiment of the present invention provides a computer device, which includes a memory and a processor. The memory stores a computer program. When the computer program is executed by the processor, the processor executes the steps of a graph classification method that combines multiple semantic views and adaptive contrast learning.

[0181] An application embodiment of the present invention provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor executes the steps of a graph classification method combining multiple semantic views and adaptive contrast learning.

[0182] An application embodiment of the present invention provides an information data processing terminal, which includes a graph classification system combining multiple semantic views and adaptive contrast learning.

[0183] It should be noted that the embodiments of the present invention can be implemented by hardware, software, or a combination of software and hardware. The hardware part can be implemented using dedicated logic; the software part can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. It can be understood by a person of ordinary skill in the art that the above-mentioned devices and methods can be implemented using computer executable instructions and / or contained in a processor control code, such as a carrier medium such as a disk, CD or DVD-ROM, a programmable memory such as a read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. Such code is provided on the carrier medium. The device and its modules of the present invention can be implemented by hardware circuits such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., can also be implemented by software executed by various types of processors, and can also be implemented by a combination of the above-mentioned hardware circuits and software, such as firmware.

[0184] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principle of the present invention should be covered by the protection scope of the present invention.

Claims

1. A graph classification system combining multiple semantic views and adaptive contrastive learning, characterized in that: include: The multi-semantic view extraction module captures high-order structural features through the WL re-labeling algorithm and word embedding model, and extracts graph features from different semantic views; Adaptive contrastive learning module, which retains important node features from multiple semantic views by adaptively generating enhanced graphs and strengthens the relationship between views through contrastive learning across semantic views. Adaptive contrastive learning optimizes the expression of node features through consistency loss; The multi-semantic view fusion module uses an attention mechanism to merge node representations from multiple views to distinguish the importance of nodes in different views, thereby generating richer and more comprehensive graph embeddings.

2. The graph classification system combining multiple semantic views and adaptive contrastive learning as claimed in claim 1, characterized in that: The multi-semantic view extraction module consists of two main parts: a multi-semantic view construction submodule and an in-view representation learning submodule; The multi-semantic view construction submodule specifically includes: The WL relabeling algorithm is used to aggregate node labels from different neighborhoods without parameters, and different views are constructed. The representation of nodes in different views is different. Subsequently, the Doc2vec model is used to perform unsupervised learning on the semantic features of nodes in each view, and the PV-DBOW word embedding model is used. The specific steps and formulas are as follows: (1) For a given graph dataset, the WL relabeling algorithm is used for L iterations to extract subtrees of different orders in each graph; each iteration generates a subtree pattern corresponding to its order, where the i-th iteration generates the i-th order subtree pattern, as shown in the following formula: in represents the i-th order subtree pattern with node v as the root, N(v) represents the set of direct neighbors of node v, and the initial subtree pattern is the label of node v, Relabel() is a string hash function, Represents a multiset; (2) All i-order subtree patterns extracted from the graph dataset G, the arrangement of the i-order subtree patterns in each graph constitutes the corpus C (i) =(θ (i) ,R (i) ), where θ (i) is a vocabulary consisting of all the different i-order subtree patterns in the graph dataset, R (i) is the set formed by the i-order subtree patterns in each graph in the dataset, and P() represents the permutation function on the elements of the set; (3) Obtain corpus C (i) After that, the present invention is in C (i) Train the Doc2vec model on to obtain (i) The feature matrix composed of the semantic representation of the subtree pattern Here, the jth row represents θ (i) The vector representation of the j-th subtree pattern in , h is the dimension of the subtree pattern vector; it is assumed that each i-order subtree pattern with a node as the root represents the node in the graph and its i-hop local neighborhood; therefore, using the semantic features of the subtree pattern as the features of the corresponding root node, it is possible to generate a specific semantic view of the original graph; (4) Finally, different order subtree patterns correspond to different semantic views. Based on the number of WL iterations L, the present invention can construct L different semantic views for g, where the node features of the mth semantic view are represented by H (m) express.

3. The graph classification system combining multiple semantic views and adaptive contrastive learning as claimed in claim 2, characterized in that: The submodule of in-view representation learning specifically includes: Use GCN to capture the graph structure to further learn meaningful representations of node features; configure different sets of weight parameters for GCN in each semantic view to explore its unique features; the node representation H obtained from the mth view (m) As the input of each GCN, the final representation of node features in multiple semantic views is as follows: in represents the adjacency matrix with self-loops added, represents the diagonal matrix, and W l is the weight matrix of the lth layer in GCN, σ() is the nonlinear activation function, 4. The graph classification system combining multiple semantic views and adaptive contrastive learning as claimed in claim 1, characterized in that: The adaptive contrastive learning module generates an enhanced view by integrating information from L different views, identifies important features from the corresponding nodes in these L views, and aggregates them to form an enhanced view representation of the node, ensuring that the enhanced view encapsulates basic information from multiple perspectives and retains important features of nodes in multiple views; This module uses multiple semantic views to adaptively generate enhanced views and compares them with L semantic views at the node level; In this comparison, positive samples are defined as nodes at the same position in the augmented view and the mth semantic view, while all different nodes from different views are considered negative samples; The multi-semantic view fusion submodule specifically includes: Using the node-level adaptive enhancement method, the attention mechanism is used to define the importance score of each node in each view. Based on these scores, a weighted sum is performed on the nodes of the semantic view to generate enhanced nodes. The enhanced graph generated by this method retains the topology and important semantic information of the graph. First, the maximum dimension of the same node in L views is calculated to obtain the intermediate node feature representation b i,j ; b i,j =max{H' i,j (1) ,H' i,j (2) ,H' i,j (3) ...H' i,j (L) }, (5) Among them, H' i (L) Yes H i (L) Node representations of different views obtained by shared GCN, H' i,j (L) represents the jth bit of the feature of the i-th node in L views, b i,j Indicates that the node features in L views take the maximum value in bitwise order; Next, calculate the intermediate node b i The attention coefficient between the nodes in L views. The intermediate node b in the mth view i and node v i The attention coefficient between is calculated as follows: in, and W are learnable vectors and matrices respectively. Finally, the present invention uses the attention score in Eq (10) to calculate the node features of the enhanced graph, and the node v in the enhanced graph i The representation is as follows: The Kullback-Leibler (KL) divergence is used to constrain the graphical representation of the enhanced view and multiple views. This uses the entire graph as input to reduce the distribution gap between the enhanced view and each view; first, by considering the entire graph, the present invention captures the dependency between the enhanced view and each view, thereby improving the accuracy of the learned representation; second, the KL divergence is applied to constrain the view to promote regularization, and the calculation formula of the KL divergence is as follows: Where p(K i ) indicates v i The distribution probability in the enhanced graph, p(H i (m) ) indicates v i The probability distribution in each view is obtained by applying a softmax function to the graph embedding.

5. The graph classification system combining multiple semantic views and adaptive contrastive learning as claimed in claim 4, characterized in that: The graph contrast learning submodule specifically includes: Different views and enhanced views are fed into the shared GCN to obtain H’ i (m) and K' i In order to transform the original embedding into a more effective and discriminative representation, the embedding after GCN is input into the projection head That is, a two-layer MLP. The formula is as follows: F i =σ(W 2 σ(W 1 K' i +b 1 )+b 2 ), (10) Where W 1 , b 1 , v is an activation function. Next, the present invention utilizes node-level contrastive learning; When τ is the temperature parameter, we define the similarity between samples, where represents the inner product. Positive samples correspond to the first term in the denominator, while negative samples correspond to the second and third terms in the denominator. Since the comparison between positive and negative samples is symmetrical, the definition of the loss of another view is similar to Equation 11. The specific formula of the contrast loss is as follows: In summary, in the contrastive learning module, we first generate adaptive graph enhancements based on multiple semantic views, and then update node features through a loss function.

6. The graph classification system combining multiple semantic views and adaptive contrastive learning as claimed in claim 1, characterized in that: The multi-semantic view fusion module uses a fusion method to combine multiple semantic views and enhanced views through an attention mechanism; it uses the view attention model to adaptively learn the importance of nodes in different views, and performs weighted fusion of node information in all views to obtain the fused node v i Embedding; for node v in the mth view i , its characteristics can be expressed as The attention value is calculated as follows: in, is the learnable weight matrix, is the bias vector. Weight The larger the value, the more important the corresponding view is for the final node representation. Therefore, the final node representation after fusion of multiple semantic views can be expressed as:

7. The graph classification system combining multiple semantic views and adaptive contrastive learning as claimed in claim 1, characterized in that: The optimization goals include: To perform graph classification tasks, the graph representation Z is obtained by applying the readout function to the fused node representations, and then Z is fed into the MLP layer to predict the graph label. The loss function is defined as the cross entropy of the label prediction: In the formula, p is the number of categories in the graph, G i The predicted probability of belonging to class j, y ij is the true label; Then combine the image classification loss, contrast loss, and view consistency loss into the overall loss: L total =αL c +βL Ic +γL con , (17) The goal is to minimize L during training. total , α, β, γ are learnable parameters used to control the contribution of each loss, and finally the optimizer is used to optimize L total Perform optimization and update model parameters.

8. A graph classification method for joint multi-semantic views and adaptive contrastive learning that implements the graph classification system for joint multi-semantic views and adaptive contrastive learning as claimed in any one of claims 1 to 7, characterized in that include: S1, captures high-order structural features through the WL re-labeling algorithm and word embedding model, and extracts graph features from different semantic views; S2, retains important node features from multiple semantic views by adaptively generating enhanced graphs, and strengthens the relationship between views through contrastive learning across semantic views. Adaptive contrastive learning optimizes the expression of node features through consistency loss; S3, uses an attention mechanism to merge node representations from multiple views to distinguish the importance of nodes in different views, thereby generating richer and more comprehensive graph embeddings.

9. A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the graph classification method of joint multi-semantic views and adaptive contrastive learning as described in any one of claims 1 to 7.

10. An information data processing terminal, comprising the graph classification system combining multiple semantic views and adaptive contrastive learning as claimed in claim 8.

Citation Information

Patent Citations

  • Structural perception graph comparative learning method based on adaptive subgraphs

    CN115131605A

  • Heterogeneous information network community discovery method based on self-supervised learning

    CN117725455A

Cited By

  • Double-path graph representation learning method for enterprise ESG rating task

    CN121094337A

  • Collaborative graph representation learning method, apparatus and device based on consistency and diversity

    CN121482504A