A personalized service method based on factor-aware graph staged negative sampling representation learning
Through the factor-perceptual graph stage negative sampling representation learning method, negative factor attributes are extracted and negative samples are selected in stages, which solves the problem of distinguishing between hard negative examples and false negative samples, and improves the accuracy and robustness of the recommendation system.
Patent Information
- Application Number
- CN202410526812.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-29
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-04-29
AI Technical Summary
The prior art is difficult to effectively distinguish between hard negative example samples and false negative samples, resulting in a decrease in model overfitting and generalization ability, especially in the process of negative sampling, false negative examples are easily sampled.
The phased negative sampling representation learning method of factor-aware graph is used to extract negative factor attributes through decoupling technology, and negative sample selection is performed in stages during the negative sampling process, including user-enhanced selection, hard negative instance generation and negative factor interpolation to reduce the sampling of false negative instances.
This improves the sample distinction ability and interpretability of the model, achieves more accurate user-personalized recommendations, and reduces the risk of overfitting the model.
Smart Images

Figure CN118377965B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data mining and recommendation, and in particular to a factor perception graph phased negative sampling representation learning personalized service method. Background Art
[0002] In the era of big data, recommender systems are widely used in various online service platforms, including e-commerce, multimedia, and location-based social networks, to cope with the problem of information overload. Among them, collaborative filtering (CF) is one of the most commonly used strategies, which uses the similarities between users or services in historical interaction data to capture user preferences.
[0003] Currently, the most popular collaborative filtering methods involve mapping users and services into a latent embedding space, and these techniques include matrix factorization and neural networks. In order to improve the quality of embeddings in recommendation systems, researchers began to model user-service interactions as graphs and use graph neural networks (GNNs) to incorporate structural information into embeddings. GNN-based CF models, such as LRGCCF, NGCF, and LightGCN, have shown good performance in large-scale Web applications.
[0004] The standard workflow of a GNN-based recommendation system starts with a user-service interaction graph, then defines an aggregation function to propagate neighborhood information, and subsequently applies a pooling operation to generate user and service embeddings. Similar to traditional recommendation methods, the objective function usually prioritizes observed user-service pairs over unobserved pairs, usually using Bayesian personalized ranking (BPR) loss. Crucially, the high quality of negative samples is critical to the performance of the model and the accuracy of recommendations.
[0005] Recently, researchers have begun to focus on how to obtain high-quality negative samples to more effectively model user preferences. Traditional methods tend to choose "easy" negative samples, but the latest research shows that using "hard" negative samples that are highly similar to user preferences can significantly improve model performance and convergence speed. In addition, it is also necessary to pay attention to "false negatives", that is, samples that are marked as negative in the training set but are misclassified as positive samples in the test set. Previous studies have shown that these false negatives can easily lead to overfitting of the model, reducing its robustness and generalization.
[0006] However, distinguishing “hard negative” samples from false negative samples is challenging, especially when designing the sampling distribution. Due to the message passing mechanism of graph neural networks, most hard negative examples usually have high similarities with false negatives, making it challenging to distinguish them simply by designing the sampling distribution. Therefore, the latest research focuses on designing novel sampling distributions to improve the model convergence speed and alleviate the problem of false negative instances. However, the challenge of how to avoid sampling false negative instances in the negative sampling process to maintain the robustness of the model still needs to be solved. Summary of the invention
[0007] In view of the shortcomings of the prior art, the present invention proposes a factor perception graph staged negative sampling representation learning personalized service method, which decouples the attributes that affect negative samples, extracts the negative factor attributes and applies them to negative sample selection to help the model perform better representation learning. Compared with traditional models, it has better recommendation ability and interpretability, and can achieve more accurate user personalized recommendations.
[0008] In order to solve the above technical problems, the technical solution of the present invention is:
[0009] A factor-aware graph phased negative sampling representation learning personalized service method includes the following steps:
[0010] Step 1: Input the user's historical tag data, where the tag data includes the user's ID and the service's ID.
[0011] Step 2: Read the labeled data and construct a user-service undirected graph G = (V, E) based on the interaction between users and services, where V and E represent the set of nodes and edges respectively. There are two types of nodes in the graph: users and services. And construct an adjacency matrix based on the undirected graph.
[0012] Step 3: Initialize the negative sample empty set, randomly select a user or service, denoted as u or i, and check whether u or i has interacted with another node that is currently interacting. If so, reselect u or i until a node that has not been interacted with is found, and add the selected u or i as a negative sample to the negative sampling set.
[0013] Step 4: Decompose the negative factors using decoupling techniques, and use contrastive learning to constrain the semantics of the negative factors.
[0014] Step 5: The first stage of the temporal factor-aware negative sampling strategy: using user augmentation to pick out true negative instances for effective training.
[0015] Step 6, the second stage of the periodic factor-aware negative sampling strategy: combine the positive and negative instances sampled in the first stage with the true negative instances to generate synthetic hard negative instances, and obtain hard negative instances for further performance optimization.
[0016] Step 7, the third stage of the periodic factor-aware negative sampling strategy: interpolate negative factors into positive instances to generate challenging and confusing positive instances, and use the gradient backpropagation technique with Bayesian personalized ranking (BPR) loss to promote transfer learning between positive instances and confusing positive instances.
[0017] Step 8. Iteratively perform graph convolution in the undirected graph G, that is, aggregate the features of the neighbors as the new representation of the target node and apply BPR loss between positive and negative samples for iterative optimization.
[0018] Step 9: Add the embedding representations of users and services at different layers as the final representation.
[0019] Step 10. Recommendation: Calculate user embedding e u Embedded with all services i The inner product of is used as the recommendation score of each service, and the services with the highest scores are recommended to the user.
[0020] The present invention has the following characteristics and beneficial effects:
[0021] With the help of decoupling technology, the present invention extracts corresponding negative factor attributes from negative samples and uses the attributes to select more suitable negative samples to help the model perform representation learning. Compared with the traditional negative sampling-based representation learning method, the present invention has better sample discrimination ability and interpretability, and can achieve more accurate user personalized recommendations.
[0022] In terms of negative sampling strategy, the present invention adopts a phased negative sampling strategy, which includes three stages. First, in the first stage, drawing on the decoupled negative sampling method, the unique aggregation mechanism of the graph neural network (GNN) is used to decompose the negative samples into two parts that reflect user preferences and those that are inconsistent with user preferences, so as to more effectively select the real negative services. Secondly, in the second stage, combined with the mixup operation, the positive and negative examples in the previous stage are combined to generate informative hard negative examples. Finally, in the third stage, a slight negative factor is introduced into the positive sample to generate a confused positive sample, thereby solving the risk of overfitting the positive sample.
[0023] Compared with the traditional negative sampling strategy, it has better sample discrimination ability and interpretability, and can achieve more accurate user personalized recommendations. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0025] Figure 1 This is a model framework diagram of an embodiment of a factor perception graph staged negative sampling representation learning personalized service method of the present invention.
[0026] Figure 2Schematic diagram of the transfer learning module between positive and negative samples in an embodiment of the present invention.
[0027] Figure 3 It is a comparison diagram of the relationship prediction for pseudo negative examples and the past service algorithm in an embodiment of the present invention. DETAILED DESCRIPTION
[0028] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.
[0029] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and the like are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first", "second", and the like may explicitly or implicitly include one or more of the features. In the description of the present invention, unless otherwise specified, "multiple" means two or more.
[0030] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood by specific circumstances.
[0031] The present invention provides a factor perception graph staged negative sampling representation learning personalized service method, such as Figure 1 As shown, the following steps are included:
[0032] Step 1: Input the user's historical tag data, where the tag data includes the user's ID and the service's ID.
[0033] Step 2: Read the historical interaction tag data between users and services, build a user-service adjacency matrix based on the interactions between users and services, and divide the training and test IDs according to the interaction time.
[0034] Step 3: Construct a negative sample set
[0035] (1) Initialize an empty negative sample set to store the sampled negative samples.
[0036] (2) For each user-service interaction pair (positive sample), perform the following steps:
[0037] a. Randomly select a user or service, denoted as u or i.
[0038] b. Check if u or i has interacted with another node that it is currently interacting with. If so, reselect u or i until a node that has not been interacted with is found.
[0039] c. Add the selected u or i as a negative sample to the negative sampling set.
[0040] (3) Repeat step 2 until the negative sample set reaches a preset size or a certain number of iterations.
[0041] Step 4: Iteratively perform graph convolution in the undirected graph G to obtain the embedded representations of users and services at different layers of the graph convolution, that is, aggregate the features of neighbors as the new representation of the target node and apply BPR loss between positive and negative samples for iterative optimization.
[0042] The graph convolution operation is defined as:
[0043]
[0044] in It refers to the set of users who have interacted with service i. It refers to the neighbor set of user u.
[0045] Step 5: Use decoupling technology to decompose the negative factor e n
[0046] e ij =g(e i ,e j )
[0047]
[0048] Where ε is the negative sample set initialized for the current user, e i , e j is the negative sample embedding representation for which the negative factor correlation coefficient needs to be calculated, g(e i ,e j ) is the feature extraction function defined in the present invention, is a negative sample, e d It is the debiased negative sample after removing the negative factor, softmax is the normalization function, and exp is the exponential function.
[0049] Contrastive learning is used to constrain the semantics of negative factors.
[0050]
[0051]
[0052] where ||e u || is the binary norm of the final representation of the user embedding, log is any logarithmic function, and M is the number of samples in the negative sample set.
[0053] Step 6: The first stage of the period-aware negative sampling strategy: adding random noise δ to promote user enhancement to select the true negative instances e m' for effective training.
[0054]
[0055] e' u =e u -δ
[0056] e” u =e u +δ
[0057]
[0058] where e m Only negative samples selected without users, e' u is the first user-enhanced perspective, e” u is the second user enhanced perspective, ε is the negative sample set, E is the set that includes the original user representation and the two enhanced perspectives, and argmax is to select the debiased negative sample with the largest score in the negative sample set and embed it into e d .
[0059] Step 7: The second stage of the period-aware negative sampling strategy: The positive instances e sampled in the first stage are v+ and true negative instance e m' Combined, synthetic hard negative instances are generated, and hard negative instances e are obtained syn For further performance optimization.
[0060] e syn =ae v+ +(1-a)e m'
[0061] Where a is the coefficient that controls the ratio of positive and negative samples during synthesis.
[0062] Step 8, the third stage of the periodic factor-aware negative sampling strategy: interpolate negative factors into positive instances to generate challenging and confusing positive instances, and use the gradient backpropagation technique with Bayesian personalized ranking (BPR) loss to promote transfer learning between positive instances and confusing positive instances, as Figure 2 As shown in the figure, there are two losses involved in this transfer learning process.
[0063]
[0064] The timing of transfer learning is controlled by the hyperparameter τ, the training round t, and the threshold T0.
[0065] Step 9: After L layers of propagation, the embedded representations of user u and service i at different layers can be obtained, and then they are added together as the final representation.
[0066]
[0067] Step 10. Recommendation: Calculate the final representation of the user embedding e u The final representation embedded with all services i The inner product of is used as the recommendation score of each service, and the services with the highest scores are recommended to the user.
[0068] Through Figure 3 As shown, it can be seen that the dotted line represents the pseudo-negative relationship prediction of the present invention, u represents the user, and i represents the service. The traditional service algorithm can only match and infer the interaction relationship between the user and the service based on the previous interaction records. The algorithm proposed in the present invention, based on the historical interaction records, additionally gives play to the characteristics of the graph convolutional network, adaptively extracts feature recognition factors, and can effectively predict the user-service relationship that has not interacted in the past, and accurately identify pseudo-negative examples.
[0069] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited to the described embodiments. For those skilled in the art, various changes, modifications, substitutions and variations of these embodiments including components are made without departing from the principles and spirit of the present invention, and still fall within the scope of protection of the present invention.
Claims
1. A factor perception graph staged negative sampling representation learning personalized service method, characterized in that: The steps include: S1. Input the user's historical tag data; S2. Read the historical interaction mark data between users and services, build a user-service undirected graph G = (V, E) based on the interaction between users and services, where V and E represent the set of nodes and edges respectively, and build an adjacency matrix based on the undirected graph; S3. Process each user-service interaction pair to obtain a negative sample set, where the user-service interaction pair is a positive sample and the negative sample is a randomly selected non-interacting user-service pair; S4. Iteratively perform graph convolution in the undirected graph G to obtain the embedded representations of users and services at different layers of the graph convolution, that is, aggregate the features of neighbors as the new representation of the target node and apply BPR loss between positive samples and negative samples for iterative optimization; S5. Decompose the negative factors from the embedded representation of the negative sample set after graph convolution using decoupling technology, and use contrastive learning to constrain the semantics of the negative factors. Decompose the negative factor e through the feature extraction function n yes ij =g(e i ,e j ) Where ε is the negative sample set initialized for the current user, e i , e j is the negative sample embedding representation for which the negative factor correlation coefficient needs to be calculated. g(e i ,e j ) is the feature extraction function, is the negative sample embedding, e d It is the debiased negative sample embedding after removing the negative factor, softmax is the normalization function, and exp is the exponential function; And use contrastive learning to constrain the semantics of negative factors. where ||e u || is the binary norm of the user's final embedding representation, log is an arbitrary logarithmic function, and M is the number of samples in the negative sample set; S6, the first stage of the period-aware negative sampling strategy: using user enhancement to select true negative samples to ensure that the loss function of contrastive learning can learn the correct semantic representation, thereby effectively training the model parameters; S7, the second stage of the period-aware negative sampling strategy: the true negative samples sampled in the first stage are combined with the positive samples to generate synthetic hard negative samples, and the hard negative samples are added to the contrastive learning loss to promote the continuous optimization of model parameters; S8. The third stage of the periodic factor-aware negative sampling strategy: interpolate negative factors into positive samples to generate challenging and confusing positive samples, and use the gradient backpropagation technique with Bayesian personalized ranking loss to promote transfer learning between positive samples and confusing positive samples, so that the model training objective is transformed from distinguishing between positive and negative samples to distinguishing between the positive sample groups themselves; S9, adding the embedding representations of users and services at different layers as the final representation; S10, Recommendation: Calculate the final user embedding representation e u With the final service embedding representation v The inner product of is used as the recommendation score of each service, and the services with the highest scores are recommended to the user.
2. According to claim 1, a factor perception graph staged negative sampling representation learning personalized service method is characterized by: In the step S1, the historical marking data includes the user ID and the service ID.
3. According to claim 2, a factor perception graph staged negative sampling representation learning personalized service method is characterized by: In step S2, historical interaction tag data between users and services is read, a user-service adjacency matrix is constructed according to the interaction between users and services, and training and test IDs are divided according to the interaction time.
4. According to claim 3, a factor perception graph staged negative sampling representation learning personalized service method is characterized in that: In step S3, constructing a negative sample set requires the following steps: (1) Initialize an empty negative sample set to store the sampled negative samples; (2) For each user-service interaction pair, perform the following steps: a. Randomly select a user or service, record the user as u and the service as v; b. Check if u or v has interacted with another node that is currently interacting. If so, Then reselect u or v until a node that has not been interacted with is found; c. Add the selected u or v as a negative sample to the negative sampling set; (3) Repeat step (2) until the negative sample set reaches a preset size or a certain number of iterations.
5. According to claim 4, a factor perception graph staged negative sampling representation learning personalized service method is characterized in that: In the step S4, The graph convolution operation is defined as: in refers to the set of users who have interacted with service v. It refers to the neighbor set of user u.
6. A method for learning personalized services by using phased negative sampling representation of factor perception graphs according to claim 5, characterized in that: In step S6, the first stage of the periodic factor-aware negative sampling strategy is to add random noise δ to promote user enhancement and select the real negative sample embedding e m' For training, the expression is as follows: And' u =and u -δ And" u =and u +δ where e m Only the negative samples selected without users are embedded, e' u is the first user-enhanced perspective embedding, e” u is the second user enhanced perspective embedding, ε is the negative sample set, E is the set that includes the original user representation and the two enhanced perspectives, and argmax is the debiased negative sample embedding e with the largest score in the negative sample set. d .
7. A method for learning personalized services by using phased negative sampling representation of factor perception graphs according to claim 6, characterized in that: In step S7, the second stage of the period factor-aware negative sampling strategy is as follows: the positive samples sampled in the first stage are embedded into e v+ and true negative sample embedding e m' Combined to generate synthetic hard negative embeddings syn , for further performance optimization, And syn =ae v+ +(1-a)e m' Where a is the coefficient that controls the ratio of positive and negative samples during synthesis.
8. The method for learning personalized services by using phased negative sampling representation of factor perception graphs according to claim 7, characterized in that: In step S8, the third stage of the periodic factor-aware negative sampling strategy is as follows: interpolating negative factors into positive samples to generate challenging and confusing positive sample embeddings, and using a gradient backpropagation technique with a Bayesian personalized ranking loss to promote transfer learning between positive sample embeddings and confusing positive sample embeddings: The timing of transfer learning is controlled by the hyperparameter τ, the training round t, and the threshold T0.
Citation Information
Patent Citations
Single-layer enhanced negative sample generation algorithm for graph neural network training
CN115858924A
Hybrid dynamic negative sampling method for knowledge graph recommendation model
CN116340501A