A knowledge graph recommendation method fusing GNN and ResNet
By integrating the knowledge graph recommendation methods of GNN and ResNet, the oversmoothing problem in deep networks is alleviated, and the model's discriminative ability is enhanced by generating virtual hard negative samples. This solves the problems of oversmoothing and insufficient negative sampling in existing technologies, and improves the accuracy and generalization ability of the recommendation model.
Patent Information
- Application Number
- CN202210768901.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-01
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2042-07-01
AI Technical Summary
The existing technologies have difficulty effectively solving the following technical problems: when dealing with massive information overload, the existing technologies have difficulty effectively solving the technical problems of integrating GNN and ResNet; the existing technologies have problems such as oversmoothing and insufficient negative sampling, resulting in insufficient accuracy and generalization ability of recommendation models.
By integrating the knowledge graph recommendation methods of GNN and ResNet, the residual network is used to alleviate the oversmoothing problem caused by deep networks, and virtual hard negative samples are used to enhance the model's ability to distinguish between positive and negative samples, thereby improving the model's recommendation performance and generalization ability.
It effectively alleviates the oversmoothing problem caused by increasing the number of GNN layers, making the representation of each node unique and distinctive. At the same time, by training the model with generated virtual hard negative samples, it improves the model's ability to distinguish the boundary between positive and negative samples, thereby enhancing the accuracy and personalization of the recommendation results.
Smart Images

Figure CN115114528B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the technical field of intelligent deep learning recommendation, and particularly relates to a knowledge graph recommendation method fusing GNN and ResNet. BACKGROUND
[0002] From e-commerce, social platforms to news websites, information overload is a serious problem that must be faced when dealing with massive amounts of information. Recommendation systems provide key support to alleviate the adverse effects of information overload. The classic collaborative filtering assumes that users with similar behaviors may have similar preferences for items, but cannot model auxiliary information, so there are problems of sparsity and cold start.
[0003] Among various auxiliary information, the rich semantic association between knowledge graphs helps to explore the potential connection between items and items, improve the accuracy of the recommendation result; the various types of relationships in the knowledge graph help to expand the user's interest preferences and increase the diversity of the recommended items; the knowledge graph connects the user's historical preferences and the recommended items, thereby enhancing the explainability of the recommendation system.
[0004] In order to utilize the knowledge graph information, researchers have developed many knowledge graph-based recommendation systems, and explored an end-to-end way to model high-order relationships and recursively propagate embeddings from neighbor nodes. These methods model high-order item connection information through multi-layer GNN to mine potential item attributes, and fully utilize the rich information contained in the knowledge graph.
[0005] Although the above-mentioned methods use high-order information to model relationships and achieve good recommendation results, there are still some problems: 1) the influence of over-smoothing problem. Most of these methods use multi-layer GNN to model relationships, but with the increase of GNN layers, the over-smoothing problem is inevitable, which makes the representation of each node consistent. 2) the influence of insufficient and imperfect negative sampling. Reasonable negative samples can enable the recommendation system to learn effective information, but most interactions in real application scenarios are in the form of implicit feedback, which poses a fundamental challenge to the learning of the recommendation model. SUMMARY
[0006] The purpose of the present application is to provide a knowledge graph recommendation method fusing GNN and ResNet, which can alleviate the over-smoothing problem caused by deep network through residual network, and enhance the ability of the model to distinguish the boundary between positive and negative samples by using virtual hard negative samples, thereby improving the recommendation performance and generalization ability of the model.
[0007] To achieve the above purpose, the present application provides a knowledge graph recommendation method fusing GNN and ResNet, comprising:
[0008] Embedding user representation in the user-item bipartite graph and item representation in the knowledge graph through the GNN model;
[0009] Adding a residual connection between the output vectors of each layer of the GNN model, so that the node representations of each layer have distinguishability, thereby ensuring the uniqueness and uniqueness of each node;
[0010] Obtaining high-quality difficult negative samples containing rich information based on the combination of gated interpolation mixing and hierarchical sampling;
[0011] Sum-pooling operation is performed on the user representation and item representation to generate user embedding representation and item embedding representation for prediction;
[0012] Through the user embedding representation and item embedding representation, a predicted matching score is obtained, and recommendation is performed based on the matching score.
[0013] Further, embedding user representation in the user-item bipartite graph and item representation in the knowledge graph through the GNN model, specifically:
[0014] Extracting user representation in the user-item bipartite graph as input of the GNN model; constructing intention vector according to the relationship, learning the weight of each neighbor in the propagation process through attention mechanism, fusing different amounts of intention information for different users, so as to ensure that different intentions contribute differently to user representation, thereby better learning user preference and improving user embedding quality;
[0015] Extracting item representation in the knowledge graph as input of the GNN model; integrating relationship information when aggregating item neighbor information, integrating relationship perception information from connected entities to generate item representation, which can better represent the difference between different entities.
[0016] Further, the residual connection is to add the item representation of the previous layer network of the GNN model to the current layer, so that each node has uniqueness, and the inevitable oversmoothing problem caused by using a multi-layer graph neural network to model high-order relationships is alleviated.
[0017] Further, the combination of gated interpolation mixing and hierarchical sampling is used to obtain high-quality difficult negative samples containing rich information, specifically:
[0018] In order to obtain negative samples containing more information, instead of uniform negative sampling mode, the application constructs negative samples through data enhancement and metric learning mode. According to the negative sampling mode, n items are randomly selected to form a candidate negative sample set ε with a size of n*(L+1), wherein each candidate negative sample n e ε contains L+1 vector representations output by the L-layer GNN model;
[0019] The positive sample is added to the candidate negative sample set ε to form a virtual candidate negative sample set
[0020] The gating unit adaptively learns the mixed ratio of positive and negative samples, and learns a nonlinear gate through dimension reweighting to adjust the mixed ratio of positive and negative samples at the feature granularity.
[0021] The negative sample representation containing rich information should be closer to the positive sample representation, and the inner product score with the user representation should be larger, so the invention selects a negative sample with the largest inner product score with the user as the negative sampling result representation of the layer.
[0022] For each layer l of the GNN model, 0≤l≤L, from Sample candidate negative sample embeddings It contains the embedding representation of all layers of the candidate negative sample set ε.
[0023] Further, the predicted matching score is obtained by the user embedding representation and the item embedding representation, specifically:
[0024] The user embedding representation And the item embedding representation Inner product is performed to predict the matching score
[0025] Pairwise BPR loss is used to reconstruct the historical data, i.e. the historical item prediction score of a given user u Should be higher than the unobserved item prediction score
[0026] Combine the negative sampling loss And the BPR loss Minimize the objective function To learn the prediction model parameters.
[0027] The above technical solutions adopted by the invention have the advantages compared with the prior art: the invention effectively alleviates the over-smoothing problem caused by the increase of the number of GNN layers, so that the representation of each node has uniqueness and uniqueness. At the same time, by using the generated virtual difficult negative sample for model training, the recommendation model can better distinguish the boundary between positive and negative samples, improve the generalization ability and robustness of the model, and the recommendation result is more accurate and has the advantages of personalization. BRIEF DESCRIPTION OF DRAWINGS
[0028] Figure 1 It is a knowledge graph recommendation method flowchart of an embodiment of the invention which fuses GNN and ResNet;
[0029] Figure 2 It is a GNN model residual connection schematic diagram in the embodiment.
[0030] Figure 3 A negative sampling module framework in the embodiment;
[0031] Figure 4 A negative sampling example graph of the knowledge graph in the embodiment;
[0032] Figure 5 An addition pooling operation example graph in the embodiment;
[0033] Figure 6 A recommendation model structure schematic diagram in the embodiment. DETAILED DESCRIPTION
[0034] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application is described and explained in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the present application.
[0035] Hereinafter, the embodiments of the present application are described in detail in combination with the drawings:
[0036] As shown in Figure 1 The present embodiment provides a knowledge graph recommendation method fusing GNN and ResNet, including a user item embedding step, a residual connection step, a negative sampling step, an addition pooling step, and a prediction optimization step.
[0037] The recommendation method of the present embodiment can be used to perform entity recommendation according to the user item bipartite graph and the knowledge graph of a plurality of objects (i.e. different entities, such as online shopping goods) that can be recommended after the user item bipartite graph and the knowledge graph of the plurality of objects are established. It can be integrated in a recommendation application that needs to perform entity recommendation for users, and the recommendation application can be a shopping website, a comprehensive content publishing website, and a related APP, etc.
[0038] The embodiment aims at the oversmoothing problem caused by high-order relationship modeling of the neural network, and uses a residual network to add the output representation of the previous layer to the current layer to ensure the diversity of the output information. In order to better generate high-quality negative samples, a gating mechanism is used to mix and inject positive sample information into negative samples, and the size of the injected information is adaptively learned, so as to pollute the negative samples. A difficult negative sample selection strategy is adopted, virtual negative samples and their representations are obtained through data enhancement, aggregation and other methods, and the virtual negative sample representation closest to the positive sample representation is selected for model training, so that the recommender can train on more complex data and improve the generalization ability of the model. Through the pooling operation, all output layer information is integrated to make the node fused with high-order information more distinguishable, thereby further relieving the oversmoothing problem. Continuous prediction optimization improves the performance of the model, and the generalization ability of the model is also greatly improved. The specific working principle of each step is described as follows.
[0039] Step 1. Embedding user representation in user-item bipartite graph and item representation in knowledge graph through GNN model;
[0040] Specifically, in a web-scale recommendation system, user ID and item ID are usually encoded into a one-hot vector. The ID of the user and the item is converted into an embedding vector: e i =E·x i , wherein is an initial vector table of user-item, x i is the ID (one-hot vector) of a user or an item, is an aggregated embedding, M and N are the number of users and the number of items respectively, and d0 is the dimension of the initial embedding.
[0041] The user-item bipartite graph is a typical heterogeneous information graph that can preserve the structural information of the graph; the application constructs an intention vector according to the relationship, learns the weight of each neighbor in the propagation process through the attention mechanism, and fuses different amounts of intention information for different users, thereby removing the feature transformation and nonlinear transformation in the traditional GNN model and accelerating the training process of the network; the embedding representation of the user u is:
[0042]
[0043] is the first-order embedding representation of the user u, is the ID embedding of the item i, and is an element-wise multiplication, S u represents the first-order item neighbor set of the user u, and e p represents the embedding representation of the intention p.
[0044] The attention score a is defined as follows:
[0045]
[0046]
[0047] is the initial ID embedding of user u.
[0048] The knowledge graph contains a large amount of external item information, such as (The Revenant, director, Alejandro Gonzalez Inarritu), (The Revenant, starring, Leonardo DiCaprio) and the like, a large amount of information about The Revenant is contained in the triplets, and the item representation can be better generated by aggregating the information in the item representation. The application integrates the relationship perception information from the connected entities to generate the representation of item i:
[0049]
[0050] is the first-order embedding representation of item i, is the ID embedding of entity v, e r is the embedding representation of relationship r; S i is the first-order entity neighbor set of item i. β(i, r) represents the attention score distinguishing the importance of different relationships, and is defined as follows:
[0051]
[0052]
[0053] Step 2. Add a residual connection between the output vectors of each layer of the GNN model, so that the node representations of each layer have distinguishing degrees, thereby ensuring the uniqueness and uniqueness of each node;
[0054] Specifically, as shown in Figure 2 , the embodiment uses a graph residual learning framework in the item embedding process, and learns the item embedding representation of the layer through a residual representation function:
[0055]
[0056] respectively represent the lth layer representation of user u and item i; γ represents a unit matrix for assigning weights to the residual connection.
[0057] Step 3. Obtain high-quality difficult negative samples containing rich information by combining the gating interpolation mixing and hierarchical sampling;
[0058] Specifically, as shown in Figure 3 , the embodiment adds the positive sample information to the candidate negative sample set ε to form a virtual candidate negative sample set The mixture ratio of positive and negative samples is learned adaptively by a gating unit. For each candidate negative embedding The positive mixing operation is formalized as:
[0059]
[0060] where, is a mixing coefficient for each hop, sampled from (0, 1), defined as:
[0061]
[0062] w is a trainable weight, and b is a bias.
[0063] The final negative sample set ε" is obtained by the GNN hierarchical aggregation sampling manner. For each layer l (0≤l≤L) of the GNN, from ε' (l) Sampling candidate negative sample embeddings which contains the embedding representation of all layers of the candidate negative sample set ε, the candidate negative sample embedding is defined as:
[0064]
[0065] where · is the inner product operation, and f Q (u, l) is a query mapping that returns the l-th hop related embedding of the target user u.
[0066] Taking L = 1 as an example, the candidate negative sample set ε' can be sampled from Note that a and b do not need to be distinguished, i.e., a and b can be the same item.
[0067] As shown in Figure 4 User 1 has watched movie item 1 and item 2, both of which are directed by entity 1 and are of type entity 2. Therefore, it can be inferred that the combination of director entity 1 and type entity 2 is an important factor for user 1 to be interested in. User 1 is likely to know other movies directed by entity 1 but of different types (such as item 4), but user 1 is not interested in them. Therefore, the embodiment adopts items 3 and 4 as negative samples to train the recommendation model.
[0068] Step 4. Perform sum-pooling operation on the user representation and the item representation to generate user embedding representation and item embedding representation for prediction;
[0069] Specifically, as shown in Figure 5 The embodiment combines all layer embeddings (including the initial embedding) as the final feature representation of each node, making the embedding information more rich and further alleviating the over-smoothing problem, which is represented as follows:
[0070]
[0071]
[0072] The embodiment obtains the final user and item embedding representations by the sum-pooling method and uses them for recommendation prediction.
[0073] Step 5. Obtain a predicted matching score through the user embedding representation and the item embedding representation, and make a recommendation based on the matching score;
[0074] Specifically, as shown in the following formula, the embodiment performs inner product on the user and item representations when predicting and optimizing to predict the matching score: Figure 6
[0075] The pair-wise BPR loss is selected to reconstruct the historical data:
[0076]
[0077]
[0078] O={(u,i + ,i - )|(u,i + )∈O + ,(u,i - )∈O -}contains the observed data set O +
[0079] and the unobserved data set O - . σ(·) is an activation function.
[0080] By combining the negative sampling loss and the BPR loss, the recommendation model parameters are learned by minimizing the following objective function:
[0081]
[0082] wherein is the parameter set of the recommendation model.
[0083] In order to prevent the model from overfitting, the embodiment adds an L2 regularization term, and λ is a regularization coefficient.
[0084] When training the recommendation model, the parameter settings on the Amazon-Book, Last-FM, and Alibaba-iFashion three data sets are as follows: the learning rates are 10 -5 , 10 -4 , and 10 -3 , the batch is 1024, the embedding dimension is 64, the negative sample set size is 64, 64, and 32 respectively, the GNN layer is 3 layers, the optimizer is Adam, and Recall@20 and NDCG@20 are used as evaluation indexes.
[0085] In this embodiment, a residual connection is designed on the output of each layer of the GNN, and a sum-pooling operation is performed, and a new negative sampling method is designed to enable the model to sample high-quality difficult negative samples that can reflect user preferences and provide rich information. Therefore, when ranking recommended items and recommending items based on the final prediction score, not only can the semantic information and graph structure information in the knowledge graph and the user-item bipartite graph be fully utilized, but also the user's intention can be combined to make the recommended results more accurate and personalized, alleviate the over-smoothing problem caused by the deep GNN model, improve the ability of the model to distinguish the boundary between positive and negative samples, and greatly improve the recommendation performance and generalization ability of the model.
[0086] The above-described embodiments only express the implementation of the present application, and the description is more specific and detailed, but it should not be understood as limiting the scope of the patent. It should be noted that for ordinary skilled persons in the art, some modifications and improvements can be made without departing from the concept of the present application, and these are within the scope of protection of the present application. Therefore, the scope of protection of the patent of the present application should be subject to the appended claims.
Claims
1. A knowledge graph recommendation method fusing GNN and ResNet, characterized in that, The method comprises the steps of: embedding user representation in a user-item bipartite graph and item representation in a knowledge graph through a GNN model; adding a residual connection between output vectors of each layer of the GNN model, so that the node representations of each layer have distinguishability, thereby ensuring the uniqueness and uniqueness of each node; obtaining high-quality difficult negative samples containing rich information based on a combination of gated interpolation mixing and hierarchical sampling, specifically: The positive sample information is added to the candidate negative sample set ε to constitute a virtual candidate negative sample set The positive sample information is added to the candidate negative sample set ε to constitute a virtual candidate negative sample set The positive sample information is added to the candidate negative sample set ε to constitute a virtual candidate negative sample set The positive sample information is added to the candidate negative sample set ε to constitute a virtual candidate negative sample set wherein is a mixing coefficient for sampling per hop, sampled from (0, 1), defined as follows: w is a trainable weight, and b is a bias; The final negative sample set ε is obtained by using GNN hierarchical aggregation sampling ” For each layer l of the GNN (0≤l≤L), a candidate negative sample embedding is sampled from ε '(l) which contains the embedding representation of all layers of the candidate negative sample set ε performing sum-pooling operation on the user representation and the item representation to generate user embedding representation and item embedding representation for prediction; obtaining a predicted matching score through the user embedding representation and the item embedding representation, and performing recommendation based on the matching score.
2. The method of claim 1, wherein the method is a method of knowledge graph recommendation based on fusion of GNN and ResNet. The method comprises the steps of: extracting user representation in a user-item bipartite graph as input of the GNN model: learning the weight of each neighbor in the propagation process through an attention mechanism, fusing different amounts of intention information for different users to ensure that different intention contributes differently to the user representation, thereby better learning user preference; extracting item representation in a knowledge graph as input of the GNN model: integrating relationship information when aggregating neighbor information of the item, and integrating relationship perception information from connected entities to generate the representation of the item.
3. The method of claim 1, wherein the method is a method of knowledge graph recommendation based on fusion of GNN and ResNet. The residual connection is to add the item representation of the previous layer of the GNN model to the current layer, so that each node has uniqueness.
4. The knowledge graph recommendation method of claim 1, wherein, obtaining a predicted matching score through the user embedding representation and the item embedding representation, specifically: User embedding representation and item embedding representation taking the inner product to predict their match score Reconstructing historical data using pairwise BPR loss, i.e. historical item prediction scores for a given user u Should be higher than unobserved item prediction scores Combining negative sampling loss and BPR loss Minimizing the objective function to learn the prediction model parameters.
Citation Information
Patent Citations
Graph model intelligent commodity recommendation method fusing knowledge graph and user interaction
CN113362131A
Recommendation method, recommendation system and recommendation system training method
CN114443958A