Recommendation system optimization method based on adaptive negative sampling and enhanced graph adjacency matrix
By adopting adaptive negative sampling and enhanced graph adjacency matrix methods in the ApeGNN model, the shortcomings of existing models in negative sampling and graph adjacency matrix are solved, and more efficient recommendation system performance is achieved.
Patent Information
- Application Number
- CN202411568348.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-03-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing ApeGNN model has false positive and false negative problems in negative sampling methods and graph adjacency matrix, and may introduce noise when the user or project is rich in interactions, insufficient when the interaction is scarce, and ignore the correlation between user-user and project-project.
Adaptive negative sampling method and enhanced graph adjacency matrix are used to select negative samples through adaptive hardness negative sampling (AHNSp<0), and graph collaborative filtering is improved by enhancing user-user and project-item correlation.
It reduces the impact of false positive and false negative problems and improves the performance of the recommendation system, especially in terms of user-user and project-project correlation capture, which significantly improves the graph-based recommendation effect.
Smart Images

Figure CN119598008A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of graph recommendation technology, and in particular to a recommendation system optimization method based on adaptive negative sampling and enhanced graph adjacency matrix. Background Art
[0002] In recent years, graph neural networks (GNNs) have made remarkable progress in recommender systems, whose core mechanism is the iterative neighbor information aggregation based on the user-item interaction graph.
[0003] The existing ApeGNN model introduces a node-adaptive diffusion mechanism, which enables each node to adaptively determine the diffusion weight according to the local structure (e.g., degree).
[0004] However, the negative sampling method in this model only selects negative samples with a fixed hardness level, which easily leads to false positive problems (FPP) and false negative problems (FNP). In addition, the bipartite adjacency matrix used by the ApeGNN model in graph collaborative filtering may introduce noise when user or item interactions are abundant, and may be insufficient when interactions are scarce, ignoring the correlation between users-users and items-items, which limits the aggregation of effective neighbors.
[0005] Therefore, a new solution to the above problems needs to be proposed. Summary of the invention
[0006] The purpose of the present invention is to provide a recommendation system optimization method based on adaptive negative sampling and enhanced graph adjacency matrix to solve the technical problems raised in the background technology.
[0007] To achieve the above object, the present invention provides the following technical solution: a recommendation system optimization method based on adaptive negative sampling and enhanced graph adjacency matrix, comprising at least the following steps:
[0008] S1: Pre-trained user / item embeddings based on adaptive negative sampling;
[0009] S2: enhancing a bipartite adjacency matrix, wherein the enhanced bipartite adjacency matrix at least includes enhancing the interaction between users and items and capturing the correlation between users and items;
[0010] S3: Relearning Graph Collaborative Filtering with Enhanced Bipartite Adjacency, Using an Enhanced Graph Adjacency Matrix Relearning the graph encoder to generate embeddings for user-item interaction prediction, thereby optimizing the recommender system.
[0011] Furthermore, the S1 at least comprises the following steps:
[0012] Using the original adjacency matrix The imperfect graph Laplacian matrix L is defined as the normalized symmetric Laplacian matrix D is the degree matrix;
[0013] Pretrain a graph encoder to obtain user / item representations:
[0014] User and item embeddings are represented as Where d represents the latent dimension of the embedding;
[0015] Integrate high-order collaboration signals by stacking multiple layers of graph convolution on the user-item adjacency matrix A;
[0016] Use graph convolutional layers to obtain user / item embeddings E (N) The process is: E (N) =Encoder(A,E)=(L) N-1 E (0) , where E (0) =E;
[0017] For the selection of negative samples, AHNS is used p<0 Adaptive hardness negative sampling method, first randomly samples non-interactive items of fixed size to form a candidate set Then, negative samples are selected from the candidate set according to the predefined scoring function and sampling rules. The size of M is usually larger than the total number of items Much smaller, thus improving sampling efficiency. For the second sampling, the scoring function and sampling rules play a crucial role in identifying the final negative samples and are the focus of all negative sampling methods. Therefore, three hyperparameters α, β, and p are introduced in the second sampling and p<0 Carefully design the scoring function, for each candidate negative sample The scoring function is expressed as: Where α>0, β>0 and p<0 are predefined hyperparameters;
[0018] After calculating the scores of all candidate negative items according to the scoring function, a scoring set R is obtained, and then r in R is selected m The smallest i m To identify the final negative samples,
[0019] Finally, the BPR loss training data is used in the pre-training step to optimize the positive vs. negative scores;
[0020] The BPR loss function is:
[0021] Where: i + is the positive interaction item of user u, i- is the sampled negative interaction term that has no interaction with user u, e u and e i is the output embedding of users and items, σ(·) is the sigmoid function, and the inner product is used to represent the score of positive and negative pairs.
[0022] Furthermore, enhancing the interaction between the user and the project in S2 at least includes the following steps:
[0023] Using the pre-trained E (N) , generate top-K neighbors for users and items;
[0024] On the user side, define a user side hyperparameter U k To control the number of selected neighbors, so that all users have the same number of neighbors U k ;
[0025] When the number of neighbors is equal, users with more neighbors in the original data are denoised, and users with fewer neighbors are enhanced;
[0026] That is, for user u, the top-K neighbors are obtained by outputting the scores Select the element with the largest value to generate Represents the project output embedding;
[0027] And for the project side, define the project side hyperparameter I k , generate the top-K neighbors using the same process as the user end;
[0028] The enhanced user-item interaction matrix is obtained by using user-item interactions generated from both users and items.
[0029] Furthermore, capturing the user-user and item-item correlations in S2 at least includes the following steps:
[0030] For unknown user-user and item-item interactions, the original adjacency matrix The corresponding places in are filled with zero matrices;
[0031] Therefore, the user-user interaction matrix W is introduced UU and the item-item interaction matrix W II To fill these two all-zero sub-matrices, we can obtain a further enhanced adjacency matrix
[0032] That is, for a user u, through Extract the most similar user UU k ;
[0033] in represents the user output embedding, W UU [u,u k ]=1 and
[0034] For the item-item interaction matrix W II Most Similar Projects II k The same process was performed to control the number of similar items selected.
[0035] Compared with the prior art, the present invention has the following beneficial effects:
[0036] The present invention reduces the impact of FPP and FNP by adaptively selecting negative samples with appropriate hardness during training, paying more attention to lower-ranked positives and higher-ranked negatives. Secondly, a new graph adjacency matrix is introduced, which combines the correlation between users-users and items-items, and designs a user-item interaction matrix that balances the number of interactions between all users. To achieve this, a graph-based recommendation method is pre-trained to obtain the embedding of users and items, and then the user-item interaction matrix is enhanced by top-K sampling. The symmetric user-user and item-item correlation components are extended to the adjacency matrix to denoise active users and enhance inactive users.
[0037] Based on the above method, experiments were conducted on three widely used recommendation datasets: Beauty, Tools, and Office. Two common indicators for evaluating the performance of recommendation systems were used: the relevance measure Recall@N and the ranking-aware measure NDCG@N. The results showed that our model HSGDA outperformed the existing state-of-the-art GNNs-based recommendation methods, and the enhanced user-item interaction matrix not only improved the selection of neighbors, but also reduced the density, significantly improving the graph-based recommendation effect, verifying the effectiveness of the method. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for describing the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0039] Figure 1 It is a schematic diagram of the overall process of the present invention;
[0040] Figure 2 Schematic diagram of negative sample selection in the present invention. DETAILED DESCRIPTION
[0041] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0042] Recommendation system optimization method based on adaptive negative sampling and enhanced graph adjacency matrix:
[0043] Users and items are represented by u and i respectively, and the user set is represented as The collection of items is represented as Regardless of implicit or explicit feedback, the user-item interaction matrix is Where R ui Represents the user's feedback on the project. For example, R ui The value of is 0 or 1. Define the bipartite graph as use to represent the set of observed interactions, where each pair (u,i + ) represents user u and item i + The interaction between - Defined as items that have not been interacted with by the user, each pair (u,i - ) represents user u and item i - There is no interaction between them.
[0044] A pre-training and augmentation framework, GDA, is introduced to denoise and augment the user-item matrix. In this framework, user-user and item-item correlations are captured in a bipartite adjacency matrix for graph collaborative filtering. The encoder is first pre-trained to generate user / item embeddings from existing user-item interactions. With the pre-trained embeddings, a top-K sampling process is adopted to generate the denoised and augmented user-item matrix, non-zero user-user and item-item correlation matrices.
[0045] In addition, an adaptive hardness negative sampling AHNS method is introduced in the above process, using a specific instance of AHNS, called AHNS p<0 , where p is a predefined smoothing parameter. Given a positive pair (u,i + ), through this negative sampling strategy, we get the negative pair (u,i - ). Then, the model is optimized by Bayesian Personalized Ranking (BPR) loss function to make the positive pairs score higher than the negative pairs.
[0046] See also Figure 1 The specific steps are as follows:
[0047] S1: Pre-trained user / item embeddings based on adaptive negative sampling;
[0048] S2: Enhanced bipartite adjacency matrix, enhancing the bipartite adjacency matrix at least includes enhancing the interaction between users and items and capturing the correlation between users and items;
[0049] S3: Relearning Graph Collaborative Filtering with Enhanced Bipartite Adjacency, Using an Enhanced Graph Adjacency Matrix Relearning the graph encoder to generate embeddings for user-item interaction prediction, thereby optimizing the recommender system.
[0050] S1 includes at least the following steps:
[0051] Using the original adjacency matrix The imperfect graph Laplacian matrix L is defined as the normalized symmetric Laplacian matrix D is the degree matrix;
[0052] Pretrain a graph encoder to obtain user / item representations:
[0053] User and item embeddings are represented as Where d represents the latent dimension of the embedding;
[0054] Integrate high-order collaboration signals by stacking multiple layers of graph convolution on the user-item adjacency matrix A;
[0055] Use graph convolutional layers to obtain user / item embeddings E (N) The process is: E (N) =Encoder(A,E)=(L) N-1 E (0) , where E (0) =E;
[0056] For the selection of negative samples, use AHNS p<0 Adaptive hardness negative sampling method, first randomly samples non-interactive items of fixed size to form a candidate set Then, negative samples are selected from the candidate set according to the predefined scoring function and sampling rules. The size of M is usually larger than the total number of items Much smaller, thus improving sampling efficiency, for the second sampling, the scoring function and sampling rules play a vital role in identifying the final negative samples, which is the focus of all negative sampling methods. Figure 2 As shown in Figure 2, the selection of negative samples is shown. Therefore, three hyperparameters α, β, and p are introduced in the second sampling and p<0 Carefully design the scoring function, for each candidate negative sample The scoring function is expressed as: Where α>0, β>0 and p<0 are predefined hyperparameters;
[0057] After calculating the scores of all candidate negative items according to the scoring function, a scoring set R is obtained, and then r in R is selected m The smallest i m To identify the final negative samples,
[0058] Finally, the BPR loss training data is used in the pre-training step to optimize the positive vs. negative scores;
[0059] The BPR loss function is:
[0060] Where: i + is the positive interaction item of user u, i - is the sampled negative interaction term that has no interaction with user u, e u and e i is the output embedding of users and items, σ(·) is the sigmoid function, and the inner product is used to represent the score of positive and negative pairs.
[0061] In S2, enhancing the interaction between users and items includes at least the following steps:
[0062] Using the pre-trained E (N) , generate top-K neighbors for users and items;
[0063] On the user side, define a user side hyperparameter U k To control the number of selected neighbors, so that all users have the same number of neighbors U k ;
[0064] When the number of neighbors is equal, users with more neighbors in the original data are denoised, and users with fewer neighbors are enhanced;
[0065] That is, for user u, the top-K neighbors are obtained by outputting the scores Select the element with the largest value to generate Represents the project output embedding;
[0066] And for the project side, define the project side hyperparameter I k , generate the top-K neighbors using the same process as the user end;
[0067] The enhanced user-item interaction matrix is obtained by using user-item interactions generated from both users and items.
[0068] Capturing user-user and item-item dependencies in S2 includes at least the following steps:
[0069] For unknown user-user and item-item interactions, the original adjacency matrix The corresponding places in are filled with zero matrices;
[0070] Therefore, the user-user interaction matrix W is introduced UU and the item-item interaction matrix W II To fill these two all-zero sub-matrices, we can obtain a further enhanced adjacency matrix
[0071] That is, for a user u, through Extract the most similar user UU k ;
[0072] in represents the user output embedding, W UU [u,u k ]=1 and
[0073] For the item-item interaction matrix W II Most Similar Projects II K The same process was performed to control the number of similar items selected.
[0074] Based on the above method, experiments were conducted on three widely used recommendation datasets: Beauty, Tools, and Office. Two common indicators for evaluating the performance of recommendation systems were used: the relevance measure Recall@N and the ranking-aware measure NDCG@N. The results showed that our model HSGDA outperformed the existing state-of-the-art GNNs-based recommendation methods, and the enhanced user-item interaction matrix not only improved the selection of neighbors, but also reduced the density, significantly improving the graph-based recommendation effect, verifying the effectiveness of the method.
[0075]
[0076] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
Claims
1. A recommendation system optimization method based on adaptive negative sampling and enhanced graph adjacency matrix, characterized by: At least the following steps are included: S1: Pre-trained user / item embeddings based on adaptive negative sampling; S2: enhancing a bipartite adjacency matrix, wherein the enhanced bipartite adjacency matrix at least includes enhancing the interaction between users and items and capturing the correlation between users and items; S3: Relearning Graph Collaborative Filtering with Enhanced Bipartite Adjacency Using an Enhanced Graph Adjacency Matrix Relearning the graph encoder to generate embeddings for user-item interaction prediction, thereby optimizing the recommender system.
2. The method for optimizing a recommendation system based on adaptive negative sampling and enhanced graph adjacency matrix according to claim 1, characterized in that: The S1 at least comprises the following steps: Using the original adjacency matrix The imperfect graph Laplacian matrix L is defined as the normalized symmetric Laplacian matrix D is the degree matrix; Pretrain a graph encoder to obtain user / item representations: User and item embeddings are represented as Where d represents the latent dimension of the embedding; Integrate high-order collaboration signals by stacking multiple layers of graph convolution on the user-item adjacency matrix A; Use graph convolutional layers to obtain user / item embeddings E (N) The process is: E (N) =Encoder(A,E)=(L) N-1 E (0) , where E (0) =E; For the selection of negative samples, use AHNS p<0 Adaptive hardness negative sampling method, first randomly samples non-interactive items of fixed size to form a candidate set Then, negative samples are selected from the candidate set according to the predefined scoring function and sampling rules. The size of M is usually larger than the total number of items In order to improve the sampling efficiency, three hyperparameters α, β, and p were introduced in the second sampling and p<0 Carefully design the scoring function, for each candidate negative sample The scoring function is expressed as: Where α>0, β>0 and p<0 are predefined hyperparameters; After calculating the scores of all candidate negative items according to the scoring function, a scoring set R is obtained, and then r in R is selected m The smallest i m To identify the final negative samples, Finally, the BPR loss training data is used in the pre-training step to optimize the positive vs. negative scores; The BPR loss function is: Where: i + is the positive interaction item of user u, i - is the sampled negative interaction term that has no interaction with user u, e u and e i is the output embedding of users and items, σ(·) is the sigmoid function, and the inner product is used to represent the score of positive and negative pairs.
3. The method for optimizing a recommendation system based on adaptive negative sampling and enhanced graph adjacency matrix according to claim 1, characterized in that: The enhancing the interaction between the user and the item in S2 at least comprises the following steps: Using the pre-trained E (N) , generate top-K neighbors for users and items; On the user side, define a user side hyperparameter U k To control the number of selected neighbors, so that all users have the same number of neighbors U k ; When the number of neighbors is equal, users with more neighbors in the original data are denoised, and users with fewer neighbors are enhanced; That is, for user u, the top-K neighbors are obtained by outputting the scores Select the element with the largest value to generate Represents the project output embedding; And for the project side, define the project side hyperparameter I k , the same process as the user end is used to generate the top-K neighbors; The enhanced user-item interaction matrix is obtained by using user-item interactions generated from both users and items.
4. The method for optimizing a recommendation system based on adaptive negative sampling and enhanced graph adjacency matrix according to claim 3, characterized in that: Capturing the user-user and item-item correlations in S2 at least includes the following steps: For unknown user-user and item-item interactions, the original adjacency matrix The corresponding places in are filled with zero matrices; Therefore, the user-user interaction matrix W is introduced UU and the item-item interaction matrix W II To fill these two all-zero sub-matrices, we can obtain a further enhanced adjacency matrix That is, for a user u, through Extract the most similar user UU k ; in represents the user output embedding, W UU [u,u k ]=1 and For the item-item interaction matrix W II Most Similar Projects II k The same process was performed to control the number of similar items selected.
Citation Information
Patent Citations
Intelligent recommendation method for system filtering and noise reduction based on graph structure
CN116821519A
Sequence recommendation method and system based on multi-view data enhancement and graph contrast learning
CN117932158A
Recommender system using bayesian graph convolution networks
US20210248449A1