Identity-Preserving Adversarial Training Method, Device, and Medium Based on Graph Representation Learning

By generating identity-maintained adversarial samples for adversarial training, the overfitting problem caused by noise interference in graph representation learning is solved, and the accuracy and robustness of the model in multiple graph mining tasks is improved, and it is suitable for a variety of practical application scenarios.

CN114418060BActive Publication Date: 2025-08-05INST OF COMPUTING TECH CHINESE ACAD OF SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111588857.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-23
Publication Date
2025-08-05
Estimated Expiration
2041-12-23

AI Technical Summary

Technical Problem

Existing graph representation learning methods are susceptible to noise interference during training, resulting in overfitting problems, affecting the accuracy of graph structure data analysis, especially in practical application scenarios such as product recommendations, drug target predictions and financial risk control.

Method used

By generating adversarial samples that maintain the same identity information as the original sample, and introducing identity maintenance constraints, adversarial training is performed as input variables, and the graph representation learning model is updated to ensure the quality and diversity of adversarial samples, thereby improving the model's noise resistance.

Benefits of technology

The accuracy and robustness of the graph representation learning model in graph mining tasks such as node classification, anomaly detection and edge prediction are improved, and are suitable for a variety of practical application scenarios, such as product recommendation, drug target prediction and financial risk control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114418060B_ABST
    Figure CN114418060B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device, and medium for identity-preserving adversarial training based on graph representation learning. The method comprises: obtaining graph data of a training scenario, defining each node of the graph data as an original sample used to represent the training scenario, and defining the sample identity information of the original sample; generating an adversarial sample corresponding to each original sample; adding an identity-preserving constraint to the adversarial sample so that the adversarial sample retains the sample identity information of the original sample; inputting the adversarial sample as the first input variable into an initial graph representation learning model and performing identity-preserving adversarial training; updating the initial graph representation learning model to obtain a target graph representation learning model, and using the target graph representation learning model to predict the output of the original sample in the training scenario under different graph mining tasks. This method maintains the same sample identity information between the adversarial sample and the original sample, improving the accuracy of graph representation learning in graph structure data analysis and having a certain degree of universality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of graph data mining technology, and in particular to an identity-preserving adversarial training method, device, and medium based on graph representation learning. Background Art

[0002] Graph representation learning has become a hot research area for analyzing graph-structured data. At the software level, graph representation learning aims to learn an encoding function that fully leverages the advantages of graph data, transforming complex graph data into a dense representation in a low-dimensional space that preserves diverse graph attributes and structural features. Currently, graph representation learning methods are widely used in various graph mining tasks, such as node classification, anomaly detection, edge prediction, and label recommendation. They have also brought breakthroughs to a wide range of real-world applications. For example, in product recommendation scenarios, predicting user preference for a product can be formulated as an edge prediction problem, where nodes represent users or products, and edges represent their preference. Drug target prediction is another important practical application of edge prediction, where nodes represent drugs or proteins, and edges indicate whether the two interact. In financial risk control scenarios, given the transaction relationships between borrowers, it is necessary to determine the risk level of each borrower, that is, their repayment ability, to prevent loans from being granted to high-risk individuals. This scenario is a typical node classification problem, where different classes represent different risk levels. Each borrower is a node, and edges represent transaction information between borrowers.

[0003] However, these methods all ignore the noise in real-world graph data. For example, in recommendation scenarios, users may mistakenly click and like products they dislike. At the same time, they may face the problem of overfitting during algorithm training. Graph representation learning methods based on adversarial training introduce adversarial training on top of graph representation learning methods. Adversarial samples and their corresponding original samples are used together to train graph representation learning models to improve the diversity of training data and thus solve the above problems. However, since this method does not guarantee the quality of adversarial samples, it is easy to introduce erroneous information in adversarial samples and damage the performance of graph representation learning models. This affects the accuracy of graph structure data analysis in various graph mining tasks such as node classification, anomaly detection, edge prediction, and label recommendation in actual training scenarios such as product recommendation scenarios, drug target prediction, and financial risk control scenarios. Summary of the Invention

[0004] The purpose of the embodiments of the present invention is to provide an identity-preserving adversarial training method, device, storage medium, and electronic device based on graph representation learning. The adversarial samples generated by this method maintain the same sample identity information as the original samples, thereby improving the accuracy of graph structure data analysis in graph representation learning in graph mining tasks.

[0005] To achieve the above objectives, the present invention provides, on one hand, an identity-preserving adversarial training method based on graph representation learning, comprising:

[0006] Obtaining graph data of a training scene, defining each node of the graph data as an original sample for representing the training scene, and defining sample identity information of the original sample;

[0007] Generate an adversarial sample corresponding to each original sample;

[0008] By adding an identity preservation constraint to the adversarial sample, the adversarial sample maintains the sample identity information of the original sample;

[0009] Input the adversarial sample as a first input variable into the initial graph representation learning model to perform identity-preserving adversarial training;

[0010] The initial graph representation learning model is updated to obtain a target graph representation learning model, and the target graph representation learning model is used to predict the output of the original sample in the training scenario under different graph mining tasks.

[0011] Optionally, generating an adversarial sample corresponding to each original sample includes:

[0012] Inputting each of the original samples as a second input variable into the initial graph representation learning model for training to obtain a representation of each of the original samples;

[0013] A perturbation factor is added to the representation of each of the original samples to generate an adversarial sample corresponding to each of the original samples.

[0014] Optionally, before adding a perturbation factor to the representation of each original sample to generate an adversarial sample corresponding to each original sample, the method further includes:

[0015] generating the perturbation factor,

[0016] The perturbation factor includes perturbation intensity and perturbation direction, wherein the perturbation intensity is used to determine the distance between the adversarial sample and the original sample, and the perturbation direction is used to determine the generation direction of the adversarial sample;

[0017] For each original sample, the generated adversarial sample is represented as:

[0018] h′ i =h i +r i *d i

[0019] Among them, r i d i 、h iare the disturbance intensity, disturbance direction, and representation corresponding to the i-th original sample respectively.

[0020] Optionally, generating the disturbance factor includes:

[0021] Determining the disturbance intensity includes:

[0022] The representation of each node's neighboring nodes is used as input to the perceptron model, and the disturbance intensity corresponding to each node is obtained through adaptive learning;

[0023] The disturbance intensity is expressed as:

[0024] r i =ReLU(W2*ReLU(W1h i ))

[0025] Among them, W1 and W2 are learnable parameters, and ReLU is the activation function;

[0026] Constructing a constraint condition satisfied by the disturbance intensity to obtain a first loss function;

[0027] The first loss function is expressed as:

[0028]

[0029] Wherein, N represents the number of nodes.

[0030] Optionally, generating the disturbance factor further includes:

[0031] Determining the disturbance direction includes:

[0032] The perturbation direction is determined by maximizing the original loss function direction of the initial graph representation learning model, and the perturbation direction is expressed as:

[0033]

[0034] Among them, L basic Denotes that the initial graph represents the original loss function of the learning model.

[0035] Optionally, adding an identity preservation constraint to the adversarial sample so as to preserve the sample identity information of the original sample includes:

[0036] Constructing the identity preservation constraint includes:

[0037] Negatively sampling each of the nodes, constructing the identity preservation constraint, and obtaining a second loss function;

[0038] The second loss function is expressed as:

[0039]

[0040] Among them, h k is the representation of the kth node, i≠k; p(n) represents the probability of each node being sampled, and negative sampling is performed according to uniform distribution; K is the number of negative samples; σ(h′ i , h i ) represents the relationship between the original sample and its corresponding adversarial sample; σ(h′ i , h k ) represents the relationship between the original sample and its non-corresponding adversarial sample;

[0041] A binary classification discriminator is used to correspond the representation of each node of the original sample to a category according to the second loss function.

[0042] Optionally, updating the initial graph representation learning model to obtain a target graph representation learning model, and using the target graph representation learning model to predict outputs of the original samples in the training scenario under different graph mining tasks, includes:

[0043] Determine the overall loss function, which is expressed as:

[0044] L=L basic +λ1L basic +λ2L id +λ3L norm

[0045] Among them, λ1, λ2, and λ3 represent convergence factors; L basic Indicates the original loss function of the initial graph representation learning model, L norm Represents the first loss function, L id Denotes the second loss function, L′ basic represents a third loss function obtained by inputting the adversarial sample as the first input variable into the initial graph representation learning model and performing identity-preserving adversarial training;

[0046] According to the overall loss function, the initial graph representation learning model is updated using a gradient back-propagation method to obtain a target graph representation learning model;

[0047] The target graph representation learning model is used to predict the output of the original sample in the training scenario under different graph mining tasks.

[0048] Optionally, the training scenario includes a product recommendation scenario, and the method includes:

[0049] Obtain graph data of the product recommendation scenario, define the nodes in the graph data that are used to represent the product recommendation scenario containing user characteristic attributes as user information original samples, and define the nodes that are used to represent the product recommendation scenario containing product characteristic attributes as product information original samples; define the user's own serial number information as sample identity information of the user information original sample, and define the product's own serial number information as sample identity information of the product information original sample;

[0050] Generate an adversarial sample corresponding to each original sample;

[0051] By adding an identity preservation constraint to the adversarial sample, the adversarial sample maintains the sample identity information of the original sample;

[0052] Input the adversarial sample as a first input variable into the initial graph representation learning model to perform identity-preserving adversarial training;

[0053] The initial graph representation learning model is updated to obtain a target graph representation learning model, and the target graph representation learning model is used to obtain association data between the original sample of user information and the original sample of product information in the product recommendation scenario to predict the user's preference for the product.

[0054] Another aspect of the present invention provides an identity-preserving adversarial training apparatus based on graph representation learning, comprising:

[0055] An original sample acquisition module is used to acquire graph data of a training scene, define each node of the graph data as an original sample for representing the training scene, and define sample identity information of the original sample;

[0056] An adversarial sample generation module, configured to generate an adversarial sample corresponding to each original sample;

[0057] An adversarial sample constraint module, configured to add an identity preservation constraint to the adversarial sample so as to preserve the sample identity information of the original sample;

[0058] an adversarial training module, configured to input the adversarial sample as a first input variable into an initial graph representation learning model and perform identity-preserving adversarial training;

[0059] A model updating module is used to update the initial graph representation learning model to obtain a target graph representation learning model, and use the target graph representation learning model to predict the output of the original sample in the training scenario under different graph mining tasks.

[0060] On the other hand, the present invention also provides a storage medium for storing a computer program for executing the above-mentioned identity-preserving adversarial training method based on graph representation learning.

[0061] On the other hand, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the above-mentioned identity-preserving adversarial training method based on graph representation learning when executing the computer program.

[0062] In an embodiment of the present invention, by adding a perturbation factor to the representation of the original sample, an adversarial sample that is most likely to be misjudged by the graph representation learning model is generated, and the effect of the graph representation learning model can be improved with a minimum number of adversarial samples. After generating the adversarial sample, an identity-preserving regularization constraint is introduced, and an identity-preserving constraint is added to the adversarial sample so that the adversarial sample maintains the identity of the original sample, that is, it is ensured that the generated adversarial sample represents the same node as its corresponding original sample, thereby avoiding the introduction of additional noise, and thus enriching the training data set with high quality to ensure the quality of the adversarial sample. The generated identity-preserving adversarial sample is used as data enhancement for the original sample to train the graph representation learning model, thereby enhancing the graph representation learning model's resistance to noise, alleviating the overfitting problem in the identity-preserving adversarial training process, and improving the performance of the graph representation learning model in various graph mining tasks such as node classification, anomaly detection, edge prediction, and label recommendation. This identity-preserving adversarial training method has good universality. By analyzing the correlation between the representations of the original samples output by the graph representation learning model or their categories, it predicts the output of the original samples in the training scenario under different graph mining tasks. It can perform target prediction for different scenarios and is suitable for various scenarios such as product recommendation scenarios, drug target prediction scenarios, and financial risk control scenarios. It performs data prediction for various graph mining tasks such as node classification, anomaly detection, edge prediction, and label recommendation in different scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] Figure 1 1 is a flow chart of an identity-preserving adversarial training method based on graph representation learning provided by an embodiment of the present invention;

[0064] Figure 2 This is a schematic diagram of the robustness of nodes to random noise in the Cora dataset;

[0065] Figure 3 This is a diagram showing the robustness of nodes to random noise in the Citeseer dataset.

[0066] Figure 4 2 is a schematic structural diagram of an identity-preserving adversarial training device based on graph representation learning according to the present invention;

[0067] Figure 5 It is a structural diagram of an electronic device. DETAILED DESCRIPTION

[0068] In order to make the above features and effects of the present invention more clearly understood, embodiments are given below and described in detail with reference to the accompanying drawings.

[0069] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0070] It should be noted that references to "one embodiment," "an embodiment," "an example embodiment," etc., in this specification indicate that the described embodiment may include specific features, structures, or characteristics, but not every embodiment must include these specific features, structures, or characteristics. Furthermore, such references do not necessarily refer to the same embodiment. Furthermore, when specific features, structures, or characteristics are described in conjunction with an embodiment, whether or not explicitly described, it is understood that incorporating such features, structures, or characteristics into other embodiments is within the knowledge of those skilled in the art.

[0071] In addition, certain words are used in the specification and subsequent claims to refer to specific components or parts. It should be understood by those with ordinary knowledge in the relevant field that manufacturers may use different nouns or terms to refer to the same component or part. This specification and subsequent claims do not use differences in names as a way to distinguish components or parts, but rather use differences in the functions of components or parts as the criteria for distinction. The words "including" and "comprising" mentioned throughout the specification and subsequent claims are open-ended terms and should be interpreted as "including but not limited to". In addition, the word "connect" here includes any direct and indirect electrical connection means. Indirect electrical connection means include connection through other devices.

[0072] As mentioned above, in related technologies, in adversarial training for graph representation learning, adversarial samples that do not correspond to the identity of the original samples are used as enhanced data to train the model, resulting in the introduction of additional noise, which affects the performance of the graph representation learning model in various graph mining tasks such as node classification, anomaly detection, edge prediction, and label recommendation.

[0073] The first embodiment of the present invention provides an identity-preserving adversarial training method based on graph representation learning, referring to Figure 1 , Figure 1 A flowchart of a first embodiment of an identity-preserving adversarial training method based on graph representation learning is shown, which may include the following steps:

[0074] S1. Obtain graph data of a training scene, define each node of the graph data as an original sample for representing the training scene, and define sample identity information of the original sample.

[0075] In a specific implementation, in this embodiment, original sample data is obtained according to the actual needs of various graph mining tasks such as node classification, anomaly detection, edge prediction, and / or label recommendation in the training scenario. That is, by obtaining the graph data of the training scenario, the graph data contains nodes and their edge relationships, where each node is called an original sample, and each node has its own sample identity information and other attribute information. For example, when the training scenario is a product recommendation scenario, by obtaining the graph data of the product recommendation scenario, the nodes in the graph data used to characterize the product recommendation scenario containing user feature attributes are defined as user information original samples, and the nodes used to characterize the product recommendation scenario containing product feature attributes are defined as product information original samples; the user's own number information is defined as the sample identity information of the user information original sample, and the product's own number information is defined as the sample identity information of the product information original sample; the attribute information of the user information original sample represents the description of the user obtained by the system, such as age, gender, self-introduction and other information.

[0076] S2. Generate an adversarial sample corresponding to each original sample;

[0077] In this embodiment, by adding a perturbation factor to each of the original samples, adversarial samples that are most likely to be misjudged by the graph representation learning model are generated, and the effect of the graph representation learning model can be improved with a minimum of adversarial samples.

[0078] In a specific implementation, generating an adversarial sample corresponding to each original sample specifically includes:

[0079] Inputting each of the original samples as a second input variable into the initial graph representation learning model for training to obtain a representation of each of the original samples;

[0080] A perturbation factor is added to the representation of each of the original samples to generate an adversarial sample corresponding to each of the original samples.

[0081] In a specific implementation, each of the original samples is used as a second input variable and input into the initial graph representation learning model for training. This yields a representation for each original sample, i.e., the graph representation learning model outputs a vector representation for each node. This vector representation can be used to predict a variety of different graph analysis tasks. For example, in a product recommendation scenario, the original samples of product information and user information are respectively input into the initial graph representation learning model for training. The graph representation learning model then outputs representations of the original product information samples and user information samples, respectively. Perturbation factors are then added to the representations of the original product information samples and user information samples, respectively, to generate representations of the corresponding adversarial samples of product information and user information.

[0082] Specifically, for determining the perturbation factor, the perturbation factor includes perturbation intensity and perturbation direction. The perturbation intensity is used to determine the distance between the adversarial sample and the original sample, and the perturbation direction is used to determine the generation direction of the adversarial sample. For each original sample, the generated adversarial sample is represented as follows:

[0083] h′ i =h i +r i *d i

[0084] Among them, r i d i 、h i are the disturbance intensity, disturbance direction, and representation corresponding to the i-th original sample respectively.

[0085] In some embodiments, the disturbance intensity is specifically determined by taking the representation of each node's neighbor nodes as input into the perceptron model, and obtaining the disturbance intensity corresponding to each node through adaptive learning. The disturbance intensity is expressed as:

[0086] r i =ReLU(W2*ReLU(W1h i ))

[0087] Among them, W1 and W2 are learnable parameters, and ReLU is the activation function.

[0088] Because the farther the adversarial sample is from the original sample, the more likely it is to be considered a difficult sample by the graph representation learning model. Therefore, in order to generate adversarial samples that are most likely to be misjudged by the graph representation learning model, the perturbation intensity of each node is expected to be as large as possible. The constraints satisfied by the perturbation intensity are constructed to obtain the first loss function, that is, the first loss function is expressed as:

[0089]

[0090] Wherein, N represents the number of nodes.

[0091] In some embodiments, the perturbation direction is determined by maximizing the original loss function direction of the initial graph representation learning model, so that the adversarial samples generated by each original sample are difficult for the graph representation learning model. The perturbation direction is expressed as:

[0092]

[0093] Among them, L basic Denotes that the initial graph represents the original loss function of the learning model.

[0094] In a specific implementation, the disturbance direction can be processed by normalization, that is, The perturbation direction of the perturbation factor added to each of the original samples is controlled to be on the same scale.

[0095] S3. Adding an identity preservation constraint to the adversarial sample so as to preserve the sample identity information of the original sample.

[0096] In a specific implementation, the identity preservation constraint is constructed and a multi-category classification discriminator is used. According to the identity preservation constraint, the representation of the original sample is corresponded to a category; the identity preservation constraint is added to the adversarial sample so that the adversarial sample maintains the sample identity information of the original sample.

[0097] In some embodiments, by negatively sampling each node and using a binary classifier, the identity preservation constraint is constructed to obtain a second loss function. The second loss function is expressed as:

[0098]

[0099] Among them, h k is the representation corresponding to the k-th node, i≠k; p(n) represents the probability of each node on the graph being sampled. According to the uniformly distributed negative sampling, the probability of each node on the graph being sampled is the same; K is the number of negative samples.

[0100] According to the second loss function, each representation of the original sample is mapped to a category, and the identity preservation constraint is added to the adversarial sample so that the adversarial sample maintains the sample identity information of the original sample.

[0101] After generating the adversarial sample, this embodiment introduces an identity-preserving regularization constraint, adding an identity-preserving constraint to the adversarial sample so that the adversarial sample maintains the sample identity information of the original sample, that is, ensuring that the generated adversarial sample and its corresponding original sample represent the same node, thereby avoiding the introduction of additional noise, and further enriching the training data set with high quality, thereby ensuring the quality of the adversarial sample.

[0102] S4: Input the adversarial sample as the first input variable to the initial graph representation learning model, perform identity-preserving adversarial training, and obtain the third loss function L′. basic .

[0103] In this embodiment, the generated identity-preserving adversarial samples are used as data augmentation for the original samples to train the initial graph representation learning model, thereby enhancing the graph representation learning model's resistance to noise, alleviating the overfitting problem in the identity-preserving adversarial training process, and improving the performance of the graph representation learning model in various graph mining tasks such as node classification, anomaly detection, edge prediction, and label recommendation.

[0104] S5. Update the initial graph representation learning model to obtain a target graph representation learning model, and use the target graph representation learning model to predict the output of the original sample in the training scenario under different graph mining tasks.

[0105] In some embodiments, according to the first loss function L determined in steps S1-S4 above, norm , the second loss function L id , the third loss function L′ basic , and the original loss function L of the initial graph representation learning model basic , determine the overall loss function, which is expressed as:

[0106] L=L basic +λ1L basic +λ2L id +λ3L norm

[0107] Among them, λ1, λ2, and λ3 represent convergence factors.

[0108] Based on the overall loss function, the initial graph representation learning model is updated using gradient backpropagation to obtain the target graph representation learning model. After λ1, λ2, and λ3 converge, the representation of each original sample is obtained. The target graph representation learning model then generates a robust representation for each node on the graph. These representations can be used for various graph analysis tasks, such as predicting relationships between different original samples or directly outputting the class of a sample based on its representation.

[0109] For example, in a product recommendation scenario, the original samples of product information and user information are respectively input into the initial graph representation learning model for training. The graph representation learning model outputs the representation of the original samples of product information and the representation of the original samples of user information respectively. By analyzing the cosine similarity between the representation of the original samples of product information and the representation of the original samples of user information, the user's preference for the product is predicted. The greater the similarity, the higher the preference. In a drug target prediction scenario, drug information and protein information are used as original samples. By analyzing the similarity between the drug representation and the protein representation, it is possible to predict whether there is a targeting effect between the drug and the protein. In a financial risk control scenario, each borrower's information is used as the original sample, and the graph representation learning model is used to obtain the representation of each borrower. The classification model can then be used to output the risk level of each borrower.

[0110] In the above-described embodiment of the present invention, by adding a perturbation factor to the representation of the original sample, adversarial samples that are most likely to be misjudged by the graph representation learning model are generated. This allows the performance of the graph representation learning model to be improved with a minimum number of adversarial samples. After generating the adversarial samples, an identity-preserving regularization constraint is introduced to add identity-preserving constraints to the adversarial samples, ensuring that the adversarial samples maintain the identity of the original samples. This ensures that the generated adversarial samples represent the same node as their corresponding original samples, thereby avoiding the introduction of additional noise and enriching the training dataset with high quality, thereby ensuring the quality of the adversarial samples. The generated identity-preserving adversarial samples are then used as data augmentation for the original samples to train the graph representation learning model, thereby enhancing the graph representation learning model's resistance to noise, alleviating the overfitting problem during identity-preserving adversarial training, and improving the performance of the graph representation learning model in various graph mining tasks, such as node classification, anomaly detection, edge prediction, and label recommendation. This identity-preserving adversarial training method has good universality. By analyzing the correlation between the representations of the original samples output by the graph representation learning model or the categories to which they belong, it predicts the output of the original samples in the training scenario under different graph mining tasks. It can perform target prediction for different scenarios and is suitable for various scenarios such as product recommendation scenarios, drug target prediction scenarios, and financial risk control scenarios. It can perform data prediction for various graph mining tasks such as node classification, anomaly detection, edge prediction, and label recommendation in different scenarios.

[0111] In the following, under the tasks of edge prediction and node classification graph mining, the identity-preserving adversarial training method based on graph representation learning provided by the present invention is compared with the existing methods to verify the effectiveness of the method of the present invention.

[0112] The edge prediction task involves predicting whether an edge exists between any two nodes based on their node representations. It is a common task for verifying the quality of node representations. Table 1 shows the edge prediction results of the identity-preserving adversarial training method based on graph representation learning of the present invention and existing methods on the Cora, Citeseer, Wiki, and Pubmed datasets. As shown in Table 1, under the AUC evaluation metric, the identity-preserving adversarial training method based on graph representation learning provided by the present invention achieves significant improvements of 5.40%, 2.56%, 6.43%, and 1.11% compared to existing methods.

[0113] Node classification is another common task for testing the quality of node representations. This task aims to use node representations to predict certain node labels. As shown in Table 2, our identity-preserving adversarial training method based on graph representation learning consistently outperforms existing methods across three datasets: Cora, Citeseer, and Pubmed. The results for both edge prediction and node classification demonstrate that our method improves the effectiveness of node representations for downstream tasks.

[0114] Since the identity-preserving adversarial training method based on graph representation learning of the present invention improves the quality of adversarial samples, the resistance of graph representation learning to noise in graph data is enhanced. Figure 2 、 Figure 3 It shows how the accuracy of the resulting node representations on downstream tasks changes as the number of noisy edges in the input graph increases. Figure 2 Shows the robustness of node representation to random noise in the Cora dataset; Figure 3 Shows the robustness of node representation to random noise in the Citeseer dataset. Figure 2 、 Figure 3 As can be seen, on both the Cora and Citeseer datasets, the proposed identity-preserving adversarial training method based on graph representation learning consistently outperforms existing methods. Furthermore, as the proportion of noisy edges increases, the proposed identity-preserving adversarial training method achieves a greater improvement than existing methods, increasing from 2.46% to 3.97% on Cora and from 3.84% to 11.11% on Citeseer. This demonstrates that the proposed identity-preserving adversarial training method based on graph representation learning is more resistant to noise in graph data.

[0115] Table 1: Edge prediction results using AUC as the evaluation metric

[0116]

[0117]

[0118] Table 2: Node classification results with accuracy as evaluation indicator

[0119]

[0120] It should be noted that for the sake of simplicity, the method embodiments are described as a series of actions. However, those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0121] The above embodiments of the present invention can be applied to terminal devices that have the identity-preserving adversarial training method based on graph representation learning. The terminal devices may include personal terminals and host terminals, etc., and the embodiments of the present invention are not limited to this. The terminal can support operating systems such as Windows, Android, iOS, and Windows Phone.

[0122] Reference Figure 4 , Figure 4 An identity-preserving adversarial training device 300 based on graph representation learning is shown. The identity-preserving adversarial training method based on graph representation learning can be applied to personal terminals and host terminal devices, which can be implemented by Figure 1 The identity-preserving adversarial training method based on graph representation learning shown in the figure includes at least an original sample acquisition module 301, an adversarial sample generation module 302, an adversarial sample constraint module 303, an adversarial training module 304, and a model update module 305, specifically:

[0123] An identity-preserving adversarial training apparatus 300 based on graph representation learning comprises:

[0124] The original sample acquisition module 301 is used to obtain graph data of the training scene, define each node of the graph data as an original sample for representing the training scene, and define sample identity information of the original sample;

[0125] An adversarial sample generation module 302 is configured to generate an adversarial sample corresponding to each original sample;

[0126] An adversarial sample constraint module 303 is configured to add an identity preservation constraint to the adversarial sample so as to preserve the sample identity information of the original sample;

[0127] An adversarial training module 304 is configured to input the adversarial example as a first input variable into an initial graph representation learning model to perform identity-preserving adversarial training;

[0128] The model updating module 305 updates the initial graph representation learning model to obtain a target graph representation learning model, and uses the target graph representation learning model to predict the output of the original sample in the training scenario under different graph mining tasks.

[0129] Optionally, generating an adversarial sample corresponding to each original sample includes:

[0130] Inputting each of the original samples as a second input variable into the initial graph representation learning model for training to obtain a representation of each of the original samples;

[0131] A perturbation factor is added to the representation of each of the original samples to generate an adversarial sample corresponding to each of the original samples.

[0132] Optionally, before adding a perturbation factor to the representation of each original sample to generate an adversarial sample corresponding to each original sample, the method further includes:

[0133] generating the perturbation factor,

[0134] The perturbation factor includes perturbation intensity and perturbation direction, wherein the perturbation intensity is used to determine the distance between the adversarial sample and the original sample, and the perturbation direction is used to determine the generation direction of the adversarial sample;

[0135] For each original sample, the generated adversarial sample is represented as:

[0136] h′ i =h i +r i *d i

[0137] Among them, r i d i 、h i are the disturbance intensity, disturbance direction, and representation corresponding to the i-th original sample respectively.

[0138] Optionally, generating the disturbance factor includes:

[0139] Determining the disturbance intensity includes:

[0140] The representation of each node's neighboring nodes is used as input to the perceptron model, and the disturbance intensity corresponding to each node is obtained through adaptive learning;

[0141] The disturbance intensity is expressed as:

[0142] r i =ReLU(W2*ReLU(W1h i ))

[0143] Among them, W1 and W2 are learnable parameters, and ReLU is the activation function;

[0144] Constructing a constraint condition satisfied by the disturbance intensity to obtain a first loss function;

[0145] The first loss function is expressed as:

[0146]

[0147] Wherein, N represents the number of nodes.

[0148] Optionally, generating the disturbance factor further includes:

[0149] Determining the disturbance direction includes:

[0150] The perturbation direction is determined by maximizing the original loss function direction of the initial graph representation learning model, and the perturbation direction is expressed as:

[0151]

[0152] Among them, L basic Denotes that the initial graph represents the original loss function of the learning model.

[0153] Optionally, adding an identity preservation constraint to the adversarial sample so as to preserve the sample identity information of the original sample includes:

[0154] Constructing the identity preservation constraint includes:

[0155] Negatively sampling each of the nodes, constructing the identity preservation constraint, and obtaining a second loss function;

[0156] The second loss function is expressed as:

[0157]

[0158] Among them, h k is the representation of the kth node, i≠k; p(n) represents the probability of each node being sampled, and negative sampling is performed according to uniform distribution; K is the number of negative samples; σ(h′ i , h i ) represents the relationship between the original sample and its corresponding adversarial sample; σ(h′ i , h k ) represents the relationship between the original sample and its non-corresponding adversarial sample;

[0159] A binary classification discriminator is used to correspond the representation of each node of the original sample to a category according to the second loss function.

[0160] Optionally, updating the initial graph representation learning model to obtain a target graph representation learning model, and using the target graph representation learning model to predict outputs of the original samples in the training scenario under different graph mining tasks, including:

[0161] Determine the overall loss function, which is expressed as:

[0162] L=L basic +λ1L basic +λ2L id +λ3L norm

[0163] Among them, λ1, λ2, and λ3 represent convergence factors; L basic Indicates the original loss function of the initial graph representation learning model, L norm Represents the first loss function, L id Denotes the second loss function, L′ basic represents a third loss function obtained by inputting the adversarial sample as the first input variable into the initial graph representation learning model and performing identity-preserving adversarial training;

[0164] According to the overall loss function, the initial graph representation learning model is updated using a gradient back-propagation method to obtain a target graph representation learning model;

[0165] The initial graph representation learning model is updated to obtain a target graph representation learning model, and the target graph representation learning model is used to predict the output of the original sample in the training scenario under different graph mining tasks.

[0166] The present invention also provides a storage medium for storing Figure 1 The computer program for the identity-preserving adversarial training method based on graph representation learning, such as computer program instructions, when executed by a computer, can invoke or provide the method and / or technical solution according to the present invention through the operation of the computer. The program instructions for invoking the method of the present invention may be stored in a fixed or removable storage medium, and / or transmitted via a data stream in a broadcast or other signal-carrying medium, and / or stored in a storage medium that operates according to the program instructions.

[0167] Here, according to one embodiment of the present invention, a Figure 5 The electronic device 400 shown, in some embodiments, includes a storage medium 401 for storing a computer program and a processor 402 for executing the computer program, wherein, when the computer program is executed by the processor, the electronic device is triggered to execute the methods and / or technical solutions based on the aforementioned multiple embodiments. The electronic device 400 can be a terminal device such as a computer.

[0168] It should be noted that the software program of the present invention can be executed by a processor to implement the above steps or functions. Similarly, the software program of the present invention (including related data structures) can be stored in a computer-readable recording medium, for example, a RAM memory, a magnetic or optical drive or a floppy disk and similar devices. The schedule reminder method according to the present invention can be implemented on a computer as a computer-implemented method, and the executable code or part thereof for the method according to the present invention can be stored on a computer program product. Examples of computer program products include memory devices, optical storage devices, integrated circuits, servers, online software, etc. In some embodiments, the computer program product includes a non-temporary program code component stored on a computer-readable medium so as to execute the method according to the present invention when the program product is executed on a computer.

[0169] Of course, the present invention may have many other embodiments. Without departing from the spirit and essence of the present invention, those skilled in the art may make various corresponding changes and modifications based on the present invention, but these corresponding changes and modifications should all fall within the scope of protection of the claims attached to the present invention.

Claims

1. An identity-preserving adversarial training method based on graph representation learning, characterized in that include: Obtaining graph data of a training scene, defining each node of the graph data as an original sample for representing the training scene, and defining sample identity information of the original sample; Generating an adversarial sample corresponding to each original sample includes: Input each of the original samples as a second input variable into the initial graph representation learning model for training to obtain a representation of each of the original samples; Adding a perturbation factor to the representation of each original sample to generate an adversarial sample corresponding to each original sample; wherein the perturbation factor includes a perturbation strength and a perturbation direction; the perturbation strength is used to determine the distance between the adversarial sample and the original sample, which is determined by adaptive learning based on neighbor node representations using a perceptron model; the perturbation direction is used to determine the direction in which the adversarial sample is generated, which is determined by maximizing the original loss function direction of the initial graph representation learning model; By adding an identity preservation constraint to the adversarial sample, the adversarial sample maintains the sample identity information of the original sample; Input the adversarial sample as a first input variable into the initial graph representation learning model to perform identity-preserving adversarial training; The initial graph representation learning model is updated to obtain a target graph representation learning model, and the target graph representation learning model is used to predict the output of the original sample in the training scenario under different graph mining tasks.

2. The method according to claim 1, For each original sample, the generated adversarial sample is represented as: h′ i =h i +r i *d i in, r i d i 、h i are the disturbance intensity, disturbance direction, and representation corresponding to the i-th original sample respectively.

3. The method according to claim 2, characterized in that The representation of each node's neighboring nodes is used as input to the perceptron model, and the disturbance intensity corresponding to each node is obtained through adaptive learning; The disturbance intensity is expressed as: R i =ReLU(W2*ReLU(W1h i )) Among them, W1 and W2 are learnable parameters, and ReLU is the activation function; Constructing a constraint condition satisfied by the disturbance intensity to obtain a first loss function; The first loss function is expressed as: Wherein, N represents the number of nodes.

4. The method according to claim 3, characterized in that The disturbance direction is expressed as: Among them, L basic Denotes that the initial graph represents the original loss function of the learning model.

5. The method according to claim 4, characterized in that Adding an identity preservation constraint to the adversarial sample to maintain the sample identity information of the original sample includes: Constructing the identity preservation constraint includes: Negatively sampling each of the nodes, constructing the identity preservation constraint, and obtaining a second loss function; The second loss function is expressed as: Among them, h k is the representation of the kth node, i≠k; p(n) represents the probability of each node being sampled, and negative sampling is performed according to uniform distribution; K is the number of negative samples; σ(h′ i ,h i ) represents the relationship between the original sample and its corresponding adversarial sample; σ(h′ i ,h k ) represents the relationship between the original sample and its non-corresponding adversarial sample; A binary classification discriminator is used to correspond the representation of each node of the original sample to a category according to the second loss function.

6. The method according to claim 5, characterized in that The updating of the initial graph representation learning model to obtain a target graph representation learning model, and using the target graph representation learning model to predict outputs of the original samples in the training scenario under different graph mining tasks, includes: Determine the overall loss function, which is expressed as: L=L basic +λ1L′ basic +λ2L id +λ3L norm Among them, λ1, λ2, and λ3 represent convergence factors; L basic Indicates the original loss function of the initial graph representation learning model, L norm Represents the first loss function, L id Denotes the second loss function, L′ basic represents a third loss function obtained by inputting the adversarial sample as the first input variable into the initial graph representation learning model and performing identity-preserving adversarial training; According to the overall loss function, the initial graph representation learning model is updated using a gradient back-propagation method to obtain a target graph representation learning model; The target graph representation learning model is used to predict the output of the original sample in the training scenario under different graph mining tasks.

7. The identity-preserving adversarial training method based on graph representation learning according to any one of claims 1 to 6, The training scenario includes a product recommendation scenario, and the method includes: Obtain graph data of the product recommendation scenario, define the nodes in the graph data that are used to represent the product recommendation scenario containing user characteristic attributes as user information original samples, and define the nodes that are used to represent the product recommendation scenario containing product characteristic attributes as product information original samples; define the user's own serial number information as sample identity information of the user information original sample, and define the product's own serial number information as sample identity information of the product information original sample; Generating an adversarial sample corresponding to each original sample includes: Inputting each of the original samples as a second input variable into the initial graph representation learning model for training to obtain a representation of each of the original samples; Adding a perturbation factor to the representation of each original sample to generate an adversarial sample corresponding to each original sample; wherein the perturbation factor includes perturbation strength and perturbation direction, the perturbation strength is used to determine the distance between the adversarial sample and the original sample, and is determined by adaptive learning based on neighbor node representations of a perceptron model; the perturbation direction is used to determine the generation direction of the adversarial sample, and is determined by maximizing the original loss function direction of the initial graph representation learning model; By adding an identity preservation constraint to the adversarial sample, the adversarial sample maintains the sample identity information of the original sample; Input the adversarial sample as a first input variable into the initial graph representation learning model to perform identity-preserving adversarial training; The initial graph representation learning model is updated to obtain a target graph representation learning model, and the target graph representation learning model is used to obtain association data between the original sample of user information and the original sample of product information in the product recommendation scenario to predict the user's preference for the product.

8. An identity-preserving adversarial training device based on graph representation learning, characterized in that include: An original sample acquisition module is used to acquire graph data of a training scene, define each node of the graph data as an original sample for representing the training scene, and define sample identity information of the original sample; The adversarial sample generation module is used to generate an adversarial sample corresponding to each original sample, including: Input each of the original samples as a second input variable into the initial graph representation learning model for training to obtain a representation of each of the original samples; Adding a perturbation factor to the representation of each original sample to generate an adversarial sample corresponding to each original sample; wherein the perturbation factor includes perturbation strength and perturbation direction, the perturbation strength is used to determine the distance between the adversarial sample and the original sample, and is determined by adaptive learning based on neighbor node representations of a perceptron model; the perturbation direction is used to determine the generation direction of the adversarial sample, and is determined by maximizing the original loss function direction of the initial graph representation learning model; An adversarial sample constraint module, configured to add an identity preservation constraint to the adversarial sample so as to preserve the sample identity information of the original sample; an adversarial training module, configured to input the adversarial sample as a first input variable into an initial graph representation learning model and perform identity-preserving adversarial training; A model updating module is used to update the initial graph representation learning model to obtain a target graph representation learning model, and use the target graph representation learning model to predict the output of the original sample in the training scenario under different graph mining tasks.

9. A storage medium, characterized in that: Used to store a computer program for executing the identity-preserving adversarial training method based on graph representation learning according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Graph adversarial sample generation method by adding false nodes based on reinforcement learning

    CN110334742A

  • Method for resisting attacks and generating confrontation samples

    CN113822443A