Characteristic enhancement-based graph contrast learning method and apparatus, and electronic device

By enhancing features in graph comparison learning, rather than directly perturbing the graph structure, the problem of excessive false positive samples in the prior art is solved, and the effectiveness and robustness of graph comparison learning is improved.

CN119888353APending Publication Date: 2025-04-25NAT UNIV OF DEFENSE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510050765.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-13
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

In the graph comparison learning, the graph structure is damaged by adding and deleting nodes and edges, and a large number of "false positive samples" are generated, thereby reducing the learning performance, especially in data important to graph structures.

Method used

A graph comparison learning method based on feature enhancement is adopted. By inputting the original graph into the first encoder and the second encoder for feature extraction, the first embedded feature and the second embedded feature are obtained, and the features are enhanced using methods such as random discarding neurons and singular value decomposition to generate the first enhanced feature and the second enhanced feature, and finally, the comparison learning is performed based on these enhanced features.

Benefits of technology

By enhancing the graph structure at the feature representation level instead of directly perturbing it, the negative impact of structural disturbance is avoided, the effectiveness and robustness of graph comparison learning is improved, and the feature extraction and analysis effect of graph data is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119888353A_ABST
    Figure CN119888353A_ABST
Patent Text Reader

Abstract

The invention discloses a graph contrast learning method, and particularly relates to a graph contrast learning method and device based on feature enhancement and electronic equipment. The method comprises the following steps: respectively inputting an original image into a first encoder and a second encoder for feature extraction to obtain a first embedded feature and a second embedded feature; performing feature enhancement on the first embedded feature by using a first enhancement method to obtain a first enhanced feature, performing feature enhancement on the second embedded feature by using a second enhancement method to obtain a second enhanced feature, and performing feature disturbance by randomly discarding part of neurons in the first enhancement method to obtain a second enhanced feature; according to the second enhancement method, noise is added to singular values of the feature matrix, and features are reconstructed; and performing comparative learning based on the first enhanced feature and the second enhanced feature, and optimizing the embedded representation of the node through a loss function. According to the method, the effectiveness and robustness of graph contrast learning are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a graph contrast learning method, and in particular to a graph contrast learning method, device and electronic equipment based on feature enhancement. Background Art

[0002] Graph structured data regards elements as nodes and the connections between them as edges, and has been widely used in real-world scenarios, such as recommendation systems, traffic networks, protein analysis, etc. These applications require effective extraction and analysis of the features of graph data, so graph representation learning has become a hot research field and has achieved good results in practical applications.

[0003] Graph contrastive learning is a self-supervised learning method that learns graph data representation by constructing positive and negative sample pairs. Existing graph contrastive learning methods mainly enhance graph data by directly adding and deleting nodes and edges. For example, the GraphCL model uses both node discarding and edge deletion methods to enhance data. The principle of this type of method is that the enhanced graph generated by the original graph through the data enhancement method is a positive sample. However, the addition and deletion of nodes and edges will cause the graph structure to be destroyed, resulting in the enhanced graph not matching the original graph, generating a large number of "false positive samples", and thus reducing the performance of graph contrastive learning, especially for graph data where the graph structure is very important. In order to solve this problem, some models that perform enhancement processing on node features have also appeared in the prior art, such as shuffling the rows of the node feature matrix, or directly performing random masking operations.

[0004] However, these methods tend to overly disturb the basic structure of the data, resulting in a large difference in feature distribution between the original image and the enhanced image, and have poor effects on sensitive images. Summary of the invention

[0005] The technical problem to be solved by the present invention is that the above-mentioned method commonly used in the prior art is prone to excessively disturb the basic structure of the data, resulting in a large difference in feature distribution between the original image and the enhanced image, and the effect on sensitive images is very poor. In order to solve the above-mentioned problem, the present invention provides a method, device and electronic device for image comparison learning based on feature enhancement.

[0006] The content of the present invention includes:

[0007] In a first aspect, an embodiment of the present invention provides a graph contrast learning method based on feature enhancement, comprising:

[0008] The original image is input into the first encoder and the second encoder respectively for feature extraction to obtain a first embedded feature and a second embedded feature;

[0009] Using a first enhancement method to enhance the first embedded feature to obtain a first enhanced feature, using a second enhancement method to enhance the second embedded feature to obtain a second enhanced feature, the first enhancement method performs feature perturbation by randomly discarding some neurons, and the second enhancement method adds noise to the singular values ​​of the feature matrix and reconstructs the feature;

[0010] Comparative learning is performed based on the first enhanced features and the second enhanced features, and the embedding representation of the node is optimized through a loss function.

[0011] Optionally, the using a first enhancement method to perform feature enhancement on the first embedded feature to obtain a first enhanced feature includes:

[0012] The first embedded feature is input into a dynamic Dropout enhancement module for data enhancement to obtain the first enhanced feature, and the Dropout rate of the dynamic Dropout enhancement module is dynamically adjusted.

[0013] Optionally, the first enhancement feature Z′ is:

[0014]

[0015]

[0016] Among them, t is the current time step, T is the period parameter, and p min is the minimum value of the Dropout rate, p max is the maximum value of the Dropout rate, r is the masking matrix generated by the Bernoulli distribution, and Z1 is the first embedded feature.

[0017] Optionally, the using a second enhancement method to perform feature enhancement on the second embedded feature to obtain a second enhanced feature includes:

[0018] Inputting the second embedded feature into the singular value decomposition enhancement module to perform singular value decomposition to obtain a singular value matrix;

[0019] The second enhanced feature is obtained by adding a noise matrix to the singular value matrix.

[0020] Optionally, a difference between a covariance matrix of the second embedded feature and a covariance matrix of the second enhanced feature is less than or equal to a threshold.

[0021] Optionally, the second enhanced feature Z" is:

[0022] Z"=U(∑+N)V T ;

[0023] Z2=U∑V T ;

[0024] Wherein, U and V are orthogonal matrices, ∑ is the singular value matrix, N is the noise matrix, and Z2 is the first embedded feature.

[0025] Optionally, the loss function for:

[0026]

[0027] H′=σ(Z′W′+b′);

[0028] H"=σ(Z"W"+b");

[0029] Among them, Z′ is the first enhanced feature, Z" is the second enhanced feature, W′ and W" are weight matrices, b′ and b" are bias vectors, σ is the activation function, τ is the temperature coefficient, and sim is the cosine similarity.

[0030] In a second aspect, an embodiment of the present invention provides a graph contrast learning device based on feature enhancement, comprising:

[0031] An encoding module, used for inputting the original image into a first encoder and a second encoder respectively for feature extraction to obtain a first embedded feature and a second embedded feature;

[0032] A data feature enhancement module, configured to perform feature enhancement on the first embedded feature using a first enhancement method to obtain a first enhanced feature, and perform feature enhancement on the second embedded feature using a second enhancement method to obtain a second enhanced feature, wherein the first enhancement method performs feature perturbation by randomly discarding some neurons, and the second enhancement method adds noise to the singular values ​​of the feature matrix and reconstructs the feature;

[0033] A contrastive learning module is used to perform contrastive learning based on the first enhanced feature and the second enhanced feature, and optimize the embedding representation of the node through a loss function.

[0034] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a memory, a processor, and a program stored in the memory and executable on the processor; the processor is used to read the program in the memory to implement the steps in the feature-enhanced graph contrast learning method as described in the first aspect.

[0035] In a fourth aspect, an embodiment of the present invention provides a readable storage medium for storing a program, which, when executed by a processor, implements the steps in the feature-enhanced based graph contrast learning method as described in the first aspect.

[0036] In an embodiment of the present application, the original graph is input into the first encoder and the second encoder for feature extraction, respectively, to obtain the first embedded feature and the second embedded feature, and then two different enhancement methods are used for feature enhancement to obtain the first enhanced feature and the second enhanced feature, and finally the enhanced graph is input into the contrastive learning module, and the embedded representation of the node is optimized by the loss function. This method avoids the disadvantages that may be caused by structural perturbation by enhancing at the feature representation level instead of directly perturbing the graph structure, while still benefiting from the regularization and robustness of contrastive learning, thereby improving the effectiveness and robustness of graph contrastive learning. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Attached Figure 1 A flowchart of a graph contrast learning method based on feature enhancement provided by an embodiment of the present invention;

[0038] Attached Figure 2a A schematic diagram of a framework of a graph contrast learning method based on feature enhancement provided by an embodiment of the present invention;

[0039] Attached Figure 2b For attachment Figure 2a Schematic diagram of the dynamic Dropout enhancement module in [5].

[0040] Attached Figure 2c For attachment Figure 2a Schematic diagram of the singular value decomposition enhancement module in ;

[0041] Attached Figure 3 A schematic diagram of a graph contrast learning device based on feature enhancement provided by an embodiment of the present invention;

[0042] Attached Figure 4 Schematic diagram of the ablation study results of different variants of FA-GCL;

[0043] Attached Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0044] In the embodiments of the present application, the term "and / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. In the embodiments of the present application, the term "multiple" refers to two or more, and other quantifiers are similar. The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first" and "second" are generally of one type, and the number of objects is not limited. For example, the first object can be one or more.

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

[0046] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0047] The present application provides a method, device and electronic device for graph contrast learning based on feature enhancement, aiming to reduce the negative impact caused by graph structure destruction and improve the effect of graph contrast learning. Figure 1 , Figure 1 The present invention provides a flow chart of a method for graph contrast learning based on feature enhancement, which specifically includes the following steps:

[0048] Step 101: Input the original image into the first encoder and the second encoder respectively for feature extraction to obtain the first embedded feature and the second embedded feature.

[0049] Step 102: Use a first enhancement method to enhance the first embedded feature to obtain a first enhanced feature, and use a second enhancement method to enhance the second embedded feature to obtain a second enhanced feature. The first enhancement method performs feature perturbation by randomly discarding some neurons, and the second enhancement method adds noise to the singular values ​​of the feature matrix and reconstructs the feature.

[0050] Step 103: Perform comparative learning based on the first enhanced feature and the second enhanced feature, and optimize the embedded representation of the node through a loss function.

[0051] In an embodiment of the present application, the original graph is input into the first encoder and the second encoder for feature extraction, and the first embedded feature and the second embedded feature are obtained. Then, two different enhancement methods are used for feature enhancement, and the enhanced graph is input into the contrastive learning module, and the embedded representation of the node is optimized by the loss function. This method avoids the disadvantages that may be caused by structural perturbation by enhancing at the feature representation level instead of directly perturbing the graph structure, while still benefiting from the regularization and robustness of contrastive learning, thereby improving the effectiveness and robustness of graph contrastive learning.

[0052] Optionally, in some embodiments, after step 103, the method further includes:

[0053] The target graph is input into the first encoder or the second encoder for encoding processing to obtain a final graph representation, and the final graph representation is used to perform downstream tasks.

[0054] It should be understood that after performing graph contrast learning using the feature enhancement-based graph contrast learning method provided in the embodiment of the present application, the encoder after contrast learning can be used to further output the final graph representation, which can then be applied to downstream tasks, thereby achieving better application effects in different application scenarios.

[0055] For example, in the node classification task in social network analysis, the existing graph representation learning methods often have poor classification accuracy and find it difficult to capture the complex features of nodes. The graph contrast learning method based on feature enhancement provided in this application enhances node features instead of directly modifying the graph structure, thereby retaining the basic structure of the graph and improving the classification accuracy. In the node clustering task in bioinformatics, traditional methods often find it difficult to effectively distinguish highly similar nodes. The graph contrast learning method based on feature enhancement provided in this application performs data enhancement at the node feature level through contrastive learning instead of destroying the graph structure, thereby better retaining the similarity between nodes and improving the clustering effect. In the graph classification task in traffic network analysis, the existing methods are inefficient when dealing with large-scale and complex graph structures. The graph contrast learning method based on feature enhancement provided in this application optimizes the graph representation through contrastive learning, enhances the distinguishability of graph features, and makes the graph classification task more efficient and accurate when dealing with complex graph structures.

[0056] See also Figure 2a , the following will combine Figure 2a Each step of this method is described.

[0057] First, define the original graph G = (V, E), where V is the node set, E is the edge set, and each node v∈V is equipped with a feature vector x v The structure of the graph can be represented by the adjacency matrix A, where A ij =1 indicates that there is a connection between node i and node j, otherwise A ij = 0. Each row in the node feature matrix X represents the feature of a node, that is, X = [x1, x2, ..., x n ] T , where n is the number of nodes.

[0058] In contrastive learning, subgraphs or perturbations of the original graph, such as G′ and G″, are usually generated and regarded as positive or negative samples. In this application, the graph data is enhanced on the encoded features to generate enhanced features Z′ and Z″. This method can be used to train a graph neural network (GNN) encoder f(G; θ) with a parameter θ, which can effectively map the graph data to a meaningful embedding space. This embedding not only captures node features, but also reflects the graph structure, thus providing support for downstream tasks such as classification or clustering. The final learned embedding can be used for downstream tasks such as node classification, graph classification, or link prediction. By enhancing at the feature representation level instead of directly perturbing the graph structure, the method provided in this application avoids the possible disadvantages of structural perturbations, such as destroying important connection patterns, while still benefiting from the regularization and robustness of contrastive learning.

[0059] In order to avoid changes to the graph structure, the method provided in the present application first extracts feature embedding of the graph data in step 101, and then performs data enhancement on the feature part, thereby migrating the data enhancement from the structural level of the graph to the representation level, reducing interference with the graph structure.

[0060] Specifically, according to the foregoing content, X represents the node feature matrix of the graph, and A represents the adjacency matrix. The node feature matrix X is obtained by processing the word vectors contained in the node using the word embedding model. In this embodiment, the graph feature is extracted using a graph convolutional network (GCN) encoder f(G; θ), and the node feature matrix X is mapped to the graph embedding space Z.

[0061] Specifically, f(G; θ) can be characterized as follows:

[0062]

[0063]

[0064] in, is the normalized critical matrix, D is the degree matrix, W 1 is the learnable weight matrix of the first layer, σ is the activation function ReLU, H 1 It is the node representation after the first layer of convolution.

[0065]

[0066] Among them, L is the number of layers of the encoder, H L-1 is the node representation after the L-1th convolution layer, H L The node representation after the Lth layer of convolution is W L is the learnable weight matrix of the Lth layer, and by optimizing these weights θ={W 1 ,W 2 ,…,W L}, the model is able to learn effective graph embeddings.

[0067] exist Figure 2a In the specific embodiment shown, the original image is input into the first encoder and the second encoder respectively for feature extraction to obtain the first embedded feature and the second embedded feature. The first encoder and the second encoder are both GNN encoding layers, and the first encoder and the second encoder have the same structure.

[0068] Optionally, in some embodiments, the using a first enhancement method to perform feature enhancement on the first embedded feature to obtain a first enhanced feature includes:

[0069] The first embedded feature is input into a dynamic Dropout enhancement module for data enhancement to obtain the first enhanced feature, and the Dropout rate of the dynamic Dropout enhancement module is dynamically adjusted.

[0070] like Figure 2a and Figure 2b As shown, the first embedded feature is input into the dynamic Dropout enhancement module for data enhancement, the core idea of ​​which is to perform feature perturbation by randomly discarding some neurons, thereby generating diversified feature samples. In this embodiment, the Dropout rate of the dynamic Dropout enhancement module is dynamically adjusted.

[0071] Specifically, in some embodiments, a triangular wave function is used to control the dynamic change of the Dropout rate, so that the Dropout rate is different in different training stages. The dynamic Dropout rate can be characterized as:

[0072]

[0073] Among them, t is the current time step, T is the period parameter, and p minis the minimum value of the Dropout rate, p max is the maximum value of the Dropout rate.

[0074] In this embodiment, the dynamic adjustment strategy of the Dropout rate is similar to progressive regularization. Dynamic adjustment of the Dropout rate can help the model better adapt to the training objectives at different stages of training. In specific implementation, a low Dropout rate is set in the early stage, which causes less damage to the feature data. This is to ensure that the training process of the model is more stable in the early stage of training and avoid generating a large number of "false positive samples". Then gradually increase the p value to allow the model to gradually adapt to stricter regularization conditions, thereby avoiding the model's excessive dependence on training data. Set a high p value in the later stage of training to prevent the model from "remembering" the details in the training data, thereby improving the generalization ability of the model.

[0075] The first embedded feature Z1 encoded in step 101 is input into the dynamic Dropout enhancement module φ(·) to generate a first enhanced feature, wherein the first enhanced feature Z′ is:

[0076]

[0077] in, r is a masking matrix generated by Bernoulli distribution, and Z1 is the first embedded feature, that is, r~Bernoulli(p), whose dimension is the same as the input feature matrix Z1.

[0078] In the embodiment of the present application, the first enhancement method dynamically adjusts the Dropout ratio so as to adapt to different contrastive learning requirements during the training process and reduce the negative impact caused by the destruction of the graph structure.

[0079] Optionally, in some embodiments, the using a second enhancement method to perform feature enhancement on the second embedded feature to obtain a second enhanced feature includes:

[0080] Inputting the second embedded feature into the singular value decomposition enhancement module to perform singular value decomposition to obtain a singular value matrix;

[0081] The second enhanced feature is obtained by adding a noise matrix to the singular value matrix.

[0082] like Figure 2a and Figure 2cAs shown, the second embedded feature is input into the singular value decomposition enhancement module for data enhancement. Classical graph data enhancement methods are biased enhancements, while data enhancement in feature space can more easily manipulate data distribution. The core idea of ​​the singular value decomposition enhancement module in this embodiment is to generate "real samples" with better consistency by adding noise to the singular values ​​of the feature matrix and reconstructing the features based on the singular value decomposition feature enhancement method, effectively avoiding the generation of false positive samples.

[0083] Specifically, the second embedded feature Z2 is first subjected to singular value decomposition:

[0084] Z2=U∑V T ;

[0085] Among them, U and V are orthogonal matrices, and ∑ is a singular value matrix. In order to ensure unbiasedness, keep U and V unchanged, and enhance by adding a noise matrix N to the singular value matrix ∑, which can be specifically characterized as:

[0086] Z"=U(∑+N)V T ;

[0087] Wherein, N is a noise matrix. In order to ensure that the enhanced features are still unbiased, it is necessary to ensure that the expectation of the noise matrix N is 0, that is, E(N)=0. Therefore, in some embodiments, Gaussian noise in a zero-mean noise distribution is used.

[0088] In some embodiments, in order to prevent the offset of the embedded space distribution caused by excessive enhancement and to prevent the noise matrix N from introducing too large a covariance difference, the noise amplitude is controlled by limiting the Frobenius norm of N, that is, requiring ‖N‖ F ≤δ, δ is the noise intensity limit to ensure that the enhancement of the feature by noise is within a reasonable range.

[0089] Optionally, in some embodiments, a difference between a covariance matrix of the second embedded feature and a covariance matrix of the second enhanced feature is less than or equal to a threshold.

[0090] Specifically, the covariance matrix ∑ of the second enhanced feature after control enhancement is Z" The covariance matrix ∑ with the second embedded feature Z The difference meets the threshold.

[0091] The covariance matrix of the second enhanced feature ∑ Z" for:

[0092] ∑ Z" =Z" T Z"=V(∑+N) T (∑+N)V T ;

[0093] Expanding the above formula, we can get:

[0094] ∑ Z" =V(∑∑ T +∑ T N+N T ∑+N T N)V T ;

[0095] The original covariance matrix is:

[0096] ∑ Z =V∑ T ∑V T ;

[0097] From this we can get the difference Δ∑ between the two as:

[0098] Δ∑=∑ Z" -∑ Z =V(∑ T N+N T ∑+N T N)V T ;

[0099] By adjusting the amplitude and structure of the noise matrix N, we can ensure that the covariance difference ‖Δ∑‖ F ≤∈, ∈ is a threshold value, and its specific value can be set according to actual conditions and is not limited here.

[0100] In an embodiment of the present application, a feature enhancement method based on singular value decomposition adds noise to the singular values ​​of the feature matrix and reconstructs the features, thereby generating "real samples" with better consistency, effectively avoiding the generation of false positive samples.

[0101] In step 103, comparative learning is performed based on the first enhanced feature and the second enhanced feature, and the corresponding loss function is calculated to optimize the various parameters of the model. Figure 2a As shown, after feature enhancement, the enhanced first enhancement feature and the second enhancement feature are input into the projection layer for projection to facilitate the subsequent calculation of contrast loss.

[0102] The features obtained after projection can be expressed as:

[0103] H′=σ(Z′W′+b′);

[0104] H"=σ(Z"W"+b");

[0105] Among them, Z′ is the first enhanced feature, Z" is the second enhanced feature, W′ and W" are weight matrices, b′ and b" are bias vectors, and σ is the activation function.

[0106] In this embodiment, the InfoNCE loss function is used to optimize the embedding representation of the node. For a given positive sample pair and a set of negative samples, the InfoNCE loss function is calculated as follows:

[0107]

[0108] Among them, s i,j It represents the similarity of positive sample pairs, and the denominator is the sum of the similarities of positive and negative sample pairs in the batch.

[0109] Two embeddings z′ i and z″ j The cosine similarity between is defined as:

[0110]

[0111] Among them, z′ i and z″ j It is the corresponding embedding of the enhanced features of nodes or graphs. The cosine similarity ensures that the representations of the same graph are aligned (i.e., high similarity), while the representations of different graphs are separated (i.e., low similarity).

[0112] The loss function in this embodiment for:

[0113]

[0114] H′=σ(Z′W′+b′);

[0115] H"=σ(Z"W"+b");

[0116] Among them, sim(H′,H") represents the similarity of the positive sample pair, and sim(H′,H k ) represents the similarity between the positive sample and the negative sample pair, and τ is the temperature coefficient. In this embodiment, (Z′, Z″) is denoted as a positive sample pair, while the negative sample pair is constructed from enhanced views of different graphs.

[0117] In the embodiment of the present application, the InfoNCE loss function is used to optimize the embedded representation of the node. By calculating the similarity between enhanced views of the same graph and comparing them with views from different graphs, the model can learn a representation that is invariant to the graph structure and node features. By maximizing the similarity of positive sample pairs and minimizing the similarity of negative sample pairs, the effectiveness and robustness of graph comparative learning are improved.

[0118] As a specific embodiment, on the one hand, a dynamic Dropout enhancement module is constructed based on the dynamic dropout feature enhancement method. By adjusting the dropout parameters, it is better adapted to the contrastive learning training and reduces the negative impact of the graph structure destruction. On the other hand, a singular value decomposition enhancement module is constructed based on the singular value decomposition feature enhancement method. By perturbing the singular values ​​of the feature matrix, the consistency of the global information of the enhanced graph is improved, thereby improving the effect of graph contrastive learning.

[0119] See also Figure 3 The embodiment of the present invention further provides a graph contrast learning device 300 based on feature enhancement, comprising:

[0120] An encoding module 301 is used to input the original image into a first encoder and a second encoder respectively for feature extraction to obtain a first embedded feature and a second embedded feature;

[0121] A data feature enhancement module 302 is used to perform feature enhancement on the first embedded feature using a first enhancement method to obtain a first enhanced feature, and to perform feature enhancement on the second embedded feature using a second enhancement method to obtain a second enhanced feature, wherein the first enhancement method performs feature perturbation by randomly discarding some neurons, and the second enhancement method adds noise to the singular values ​​of the feature matrix and reconstructs the feature;

[0122] The contrastive learning module 303 is used to perform contrastive learning based on the first enhanced feature and the second enhanced feature, and optimize the embedding representation of the node through a loss function.

[0123] Optionally, the data feature enhancement module 302 includes:

[0124] A dynamic Dropout enhancement module is used to enhance the first embedded feature input data to obtain the first enhanced feature, and the Dropout rate of the dynamic Dropout enhancement module is dynamically adjusted.

[0125] Optionally, the first enhancement feature Z′ is:

[0126]

[0127]

[0128] Among them, t is the current time step, T is the period parameter, and p min is the minimum value of the Dropout rate, p max is the maximum value of the Dropout rate, r is the masking matrix generated by the Bernoulli distribution, and Z1 is the first embedded feature.

[0129] Optionally, the data feature enhancement module 302 includes:

[0130] The singular value decomposition enhancement module is used to perform singular value decomposition on the second embedded feature input to obtain a singular value matrix; and obtain a second enhanced feature by adding a noise matrix to the singular value matrix.

[0131] Optionally, a difference between a covariance matrix of the second embedded feature and a covariance matrix of the second enhanced feature is less than or equal to a threshold.

[0132] Optionally, the second enhanced feature Z" is:

[0133] Z"=U(∑+N)V T ;

[0134] Z2=U∑V T ;

[0135] Wherein, U and V are orthogonal matrices, ∑ is the singular value matrix, N is the noise matrix, and Z2 is the first embedded feature.

[0136] Optionally, the loss function for:

[0137]

[0138] H′=σ(Z′W′+b′);

[0139] H"=σ(Z"W"+b");

[0140] Among them, Z′ is the first enhanced feature, Z" is the second enhanced feature, W′ and W" are weight matrices, b′ and b" are bias vectors, σ is the activation function, τ is the temperature coefficient, and sim is the cosine similarity.

[0141] The image contrast learning device 300 based on feature enhancement provided in the embodiment of the present application can execute the above method embodiment, and its implementation principle and technical effects are similar, which will not be repeated in this embodiment.

[0142] The beneficial effects of the feature-enhanced graph contrast learning method provided by the present application are verified and explained below through specific experimental data. In the experiment, different data sets are used for different downstream tasks.

[0143] For the node classification task, six real-world public datasets Cora, Pubmed, Photo, Computer, Coauthor CS and WikiCS were used. For the node clustering task, Cora, Photo, CS, Computer and WikiCS were used again because recent baseline models basically use these datasets. For the graph classification task, six commonly used public datasets in the field of graph tasks NCI1, IMDB-B, MUTAG, COLLAB, RDT-Band PROTEINS were used. In order to train the model more efficiently, the same division is followed for the already split datasets in the dgl library. For other datasets, they are all split into three parts, with the ratio of training set / validation set / test set being 0.8 / 0.1 / 0.1.

[0144] like Figure 2a As shown, an embodiment of the present invention provides a model corresponding to feature-augmented graph contrastive learning, which can also be called a feature-augmented graph contrastive learning method (FA-GCL) model, referred to as the FA-GCL model. On different tasks, the FA-GCL model corresponding to feature-augmented graph contrastive learning provided in this application (hereinafter referred to as the FA-GCL model) is compared with the baseline models of each task.

[0145] For the node classification task, the baselines used are divided into two categories, including supervised reference baseline models GCN and GAT and self-supervised models GAE, DGI, MVGRL, GRACE, CCA-SSG, BGRL, LaGraph, SeeGera, and VMA. GCN and GAT learn features by aggregating information from neighboring nodes. The former uses the local structure of the graph, and the latter introduces a dynamic attention mechanism to improve the flexibility and accuracy of classification. GAE captures the implicit relationship between nodes through a generative model, while DGI uses the representation of the global graph to compare with the representation of local nodes to improve the feature learning ability of nodes. MVGRL combines the idea of ​​multi-view learning to enhance the robustness of node representation. GRACE generates positive and negative samples of the graph through contrastive learning, which drives the model to learn effective representations. CCA-SSG and BGRL further improve the effect of feature learning through collaborative learning and contrast strategies. LaGraph is an efficient graph neural network model designed for processing large-scale graph data. SeeGera is based on variational autoencoders and learns node representations by reconstructing the data of the input graph. VMA proposes a new data augmentation method to avoid destroying the original structure of the graph.

[0146] For the node clustering task, the classic clustering models K-means, Node2vec, VGAE and GAE were used, and the self-supervised models DGI, MVGRL, GRACE, CCA-SSG, BGRL, LaGraph and VMA in the node classification task were used again. K-means is an unsupervised clustering algorithm that divides data points into K similar clusters. Node2vec generates node sequences through random walks and converts them into low-dimensional vectors to capture graph structure information. VGAE combines variational inference and graph neural networks to map node features to latent space and reconstruct graph structure.

[0147] For graph classification tasks, three types of baseline models are introduced, including supervised models GCN and GIN, graph kernel methods WL and DGK, and self-supervised methods InfoGraph, GraphCL, MVGRL, SimGRACE, HGCL, LaGraph, and VMA. GIN ensures that different graph structures can be distinguished by introducing a unique aggregation function. WL and DGK achieve clustering by calculating the similarity between graphs, thereby effectively capturing the global and local features of the graph. InfoGraph and GraphCL adopt a contrastive learning strategy to improve the clustering effect by learning the relationship between the global representation and local structure of the graph. SimGRACE directly uses the original graph and its perturbed version as the input encoder, avoiding the tedious data enhancement process. HGCL focuses on contrastive learning of heterogeneous graphs and strengthens the clustering ability of diverse data.

[0148] In order to comprehensively and fairly evaluate the model performance, for classification tasks, the accuracy is used to judge the effect of the model. For clustering tasks, the NMI and ARI indicators are used to evaluate the clustering quality. These indicators ensure the fairness and accuracy of the evaluation and can effectively measure the performance of the FA-GCL model in downstream tasks.

[0149] The model with the best performance on the validation set was selected for the final test. For node-level tasks, the linear evaluation scheme in the DGI model was continued. The experiment used the Adam optimizer, and obtained the best learning rate and decay rate for different data sets through grid search. In the experiment, we used different random seeds, ran each model five times for different data sets, and calculated the average performance to avoid deviations as much as possible. We configured the hyperparameters in each baseline model according to the original text. The experiment used a logistic regression classifier. For the FA-GCL model, the hidden layer dimension of the model was set to 256, the output node feature dimension was set to 128, and the number of GCN module layers L was set to 1 or 2. The dropout rate and noise intensity will be discussed in detail in the sensitivity analysis below.

[0150] For graph-level tasks, similar to node-level tasks, the Adam optimizer is also used. The parameters of each baseline model are set according to the original text. For the FA-GCL model, the number of GCN encoder layers is set to 3, the node representation dimension is set to 32, and the batch size is set to 256. The experiment uses SVM as the classifier, and the value range of the hyperparameter C is set to C∈{10 -1 ,10 0 ,...,10 3}. All experiments are run on NVIDIA 3090Ti 24GB GPU. See Tables 1-3 for experimental results.

[0151] Table 1 Accuracy of each model under node classification task

[0152]

[0153] According to the results in Table 1, it can be seen that in the node classification tasks on six different datasets, the performance of various models has obvious differences in accuracy. The FA-GCL model proposed in the embodiment of the present application consistently outperforms other models on all datasets, achieves the highest accuracy on all datasets, and has made significant improvements on PubMed, Photo, Computer, and WikiCS. These results highlight the robustness and effectiveness of the FA-GCL method in node classification tasks, especially in challenging datasets such as PubMed and WikiCS, where it performs well. The FA-GCL model outperforms other models on all datasets, confirming its leading position in the node classification task. It continues to improve in comparisons with CCA-SSG, VMA, and other self-supervised methods, highlighting the advantages of its design in effectively capturing node representations on different datasets.

[0154] Table 2 NMI and ARI of each model under the node clustering task

[0155]

[0156] According to the results in Table 2, the experiment compared the node clustering performance of various methods on different data sets, and used NMI and ARI as evaluation indicators. The experimental results show that the FA-GCL model proposed in this application has achieved the best performance on almost all data sets, demonstrating its excellent performance and robustness in node clustering tasks. Specifically, FA-GCL's NMI and ARI on the Cora, Photo, Computer, CS, and WikiCS data sets have reached or exceeded the best results of other comparison models. Among them, FA-GCL achieved the highest value on the Photo data set and also achieved excellent performance on the CS data set, demonstrating its excellent generalization ability on different types of graph data. FA-GCL continues to lead on multiple data sets, further demonstrating its superiority and generalization ability when processing different types of graph data.

[0157] Table 3 Accuracy of each model in the image classification task

[0158]

[0159] Table 3 shows the performance of multiple models on graph classification tasks. First, it can be seen that the FA-GCL model provided in this application has achieved the best performance on all evaluable datasets, indicating that it has strong generalization capabilities on graph datasets with different characteristics. It can be seen that the FA-GCL model has demonstrated its robustness and superiority in multi-domain datasets in multiple graph classification tasks.

[0160] The following ablation experiments are conducted on three datasets in node classification and graph classification tasks to verify the practicality of the dynamic Dropout enhancement module and singular value decomposition enhancement module proposed in the FA-GCL model. Specifically, FA-GCL is compared with its two variants, namely FA-GCL w / o[D-dropout] and FA-GCL w / o[SVD] FA-GCL w / o[D-dropout] It changes the dynamically adjusted dropout feature enhancement method into a static fixed value, and uses grid search to find the optimal p value. w / o[SVD] The feature enhancement method based on singular value decomposition is changed to directly adding noise to the features for enhancement. The results of FA-GCL and its two variants are shown in Figure 4 The experimental results show that the FA-GCL proposed in this application outperforms its variants in all cases on six datasets for node classification and graph classification tasks, indicating that the design of the two core modules can significantly improve the graph representation learning performance of the model.

[0161] from Figure 3 It can be seen that compared with the variant FA-GCL w / o[D-dropout]and FA-GCL w / o[SVD] , the performance of the complete FA-GCL model on all datasets has been significantly improved. This shows that the dynamic Dropout enhancement module can more flexibly adapt to the feature changes of different datasets, effectively prevent overfitting in node classification and graph classification tasks, and the singular value decomposition enhancement module can more effectively capture the complex information of the graph structure, thereby improving model performance.

[0162] By comparing FA-GCL and FA-GCL w / o[D-dropout] It can be clearly seen that after removing the dynamic Dropout enhancement module, the drop in the node classification task dataset is greater than that in the graph classification task dataset. This may be because the enhancement of local features in the node classification task is more important than the capture of global structure, and the dynamically adjusted Dropout can better adapt to these complex local features. Without dynamic adjustment, a fixed Dropout probability may not be able to effectively prevent overfitting, especially in a network with complex local connections such as WikiCS.

[0163] By comparing FA-GCL and FA-GCL w / o[SVD] , it can be seen that in the graph classification task, the singular value decomposition enhancement module plays a more obvious role in capturing global structural features, especially MUTAG, whose biological complexity relies on fine structural information. After removing the singular value decomposition enhancement module, the model cannot effectively capture this information, resulting in a significant drop in performance. In general, the synergy of the dynamic dropout enhancement module and the singular value decomposition enhancement module can help the model flexibly adapt to feature complexity and structural complexity on different tasks and datasets, thereby improving the overall performance.

[0164] According to the above experimental results, the FA-GCL model improves the accuracy and robustness of graph representation learning by designing dynamic Dropout and feature enhancement methods based on singular value decomposition. The key to the FA-GCL model is that it efficiently enhances graph data from the perspective of features, thereby achieving advanced contrastive learning performance on multiple public datasets.

[0165] It should be noted that the division of units in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional unit in each embodiment of the present application may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0166] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a processor-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.

[0167] like Figure 5 As shown, an embodiment of the present application provides an electronic device 500, comprising: a memory 502, a processor 501, and a program stored in the memory 502 and executable on the processor 501; the processor 501 is used to read the program in the memory 502 to implement the steps in the feature-enhanced graph comparison learning method as described above.

[0168] An embodiment of the present application also provides a readable storage medium, on which a program is stored. When the program is executed by a processor, the various processes of the above-mentioned feature enhancement-based graph comparison learning method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here. Among them, the readable storage medium can be any available medium or data storage device that can be accessed by the processor, including but not limited to magnetic storage (such as floppy disk, hard disk, magnetic tape, magneto-optical disk (MO), etc.), optical storage (such as compact disk (CD), digital video disc (DVD), Blu-ray Disc (BD), high-definition versatile disc (HVD), etc.), and semiconductor memory (such as read-only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read only memory (EEPROM), non-volatile memory (NAND FLASH), solid-state drive (Solid State Disk or Solid State Drive, SSD)), etc.

[0169] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0170] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD), and includes a number of instructions for a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0171] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A graph contrast learning method based on feature enhancement, characterized in that: include: The original image is input into the first encoder and the second encoder respectively for feature extraction to obtain a first embedded feature and a second embedded feature; Using a first enhancement method to enhance the first embedded feature to obtain a first enhanced feature, using a second enhancement method to enhance the second embedded feature to obtain a second enhanced feature, the first enhancement method performs feature perturbation by randomly discarding some neurons, and the second enhancement method adds noise to the singular values ​​of the feature matrix and reconstructs the feature; Comparative learning is performed based on the first enhanced features and the second enhanced features, and the embedding representation of the node is optimized through a loss function.

2. The method according to claim 1, characterized in that: The step of using a first enhancement method to perform feature enhancement on the first embedded feature to obtain a first enhanced feature includes: The first embedded feature is input into a dynamic Dropout enhancement module for data enhancement to obtain the first enhanced feature, and the Dropout rate of the dynamic Dropout enhancement module is dynamically adjusted.

3. The method according to claim 2, characterized in that: The first enhancement feature Z ′ for: Among them, t is the current time step, T is the period parameter, and p min is the minimum value of the Dropout rate, p max is the maximum value of the Dropout rate, r is the masking matrix generated by the Bernoulli distribution, and Z1 is the first embedded feature.

4. The method according to claim 1, characterized in that: The step of using a second enhancement method to perform feature enhancement on the second embedded feature to obtain a second enhanced feature includes: Inputting the second embedded feature into the singular value decomposition enhancement module to perform singular value decomposition to obtain a singular value matrix; The second enhanced feature is obtained by adding a noise matrix to the singular value matrix.

5. The method according to claim 4, characterized in that: A difference between a covariance matrix of the second embedded feature and a covariance matrix of the second enhanced feature is less than or equal to a threshold.

6. The method according to claim 4, characterized in that: The second enhanced feature Z" is: Z"=U(∑+N)V T ; Z2=U∑V T ; Wherein, U and V are orthogonal matrices, ∑ is the singular value matrix, N is the noise matrix, and Z2 is the first embedded feature.

7. The method according to claim 1, characterized in that: The loss function for: H′=σ(Z′W′+b′); H"=σ(Z"W"+b"); Among them, Z ′ is the first enhanced feature, Z" is the second enhanced feature, W' and W" are weight matrices, b ′ and b" are bias vectors, σ is the activation function, τ is the temperature coefficient, and sim is the cosine similarity.

8. A graph contrast learning device based on feature enhancement, characterized in that: include: An encoding module, used for inputting the original image into a first encoder and a second encoder respectively for feature extraction to obtain a first embedded feature and a second embedded feature; A data feature enhancement module, configured to perform feature enhancement on the first embedded feature using a first enhancement method to obtain a first enhanced feature, and perform feature enhancement on the second embedded feature using a second enhancement method to obtain a second enhanced feature, wherein the first enhancement method performs feature perturbation by randomly discarding some neurons, and the second enhancement method adds noise to the singular values ​​of the feature matrix and reconstructs the feature; A contrastive learning module is used to perform contrastive learning based on the first enhanced feature and the second enhanced feature, and optimize the embedding representation of the node through a loss function.

9. An electronic device, comprising: A memory, a processor, and a program stored in the memory and executable on the processor; wherein the processor is used to read the program in the memory to implement the steps in the feature-enhanced graph contrast learning method as described in any one of claims 1 to 7.

10. A readable storage medium for storing a program, characterized in that: When the program is executed by a processor, the steps in the graph contrast learning method based on feature enhancement as described in any one of claims 1 to 7 are implemented.