A Recommendation Method Based on Graph Neural Networks that Integrates Knowledge and Collaborative Information

By employing a recommendation method based on graph neural networks that integrates knowledge and collaborative information, the problems of data sparsity and cold start in recommendation systems are solved. Through information propagation and fusion, the accuracy and precision of the recommendation system are improved, and more reasonable user-item representations are generated.

CN115269977BActive Publication Date: 2026-03-06YANSHAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-18
Publication Date
2026-03-06

AI Technical Summary

Technical Problem

Existing recommendation systems struggle to accurately predict user preferences for items when faced with data sparsity and cold start problems, resulting in insufficient recommendation accuracy.

Method used

A recommendation method based on graph neural networks that integrates knowledge and collaborative information is adopted. By initializing user and item embedding vectors, information propagation and fusion are carried out using knowledge graphs and collaborative information graph neural networks. Positive and negative sample preference scores are calculated, and a loss function is constructed for model training. Finally, the recommendation effect is evaluated by recall rate and normalized depreciation cumulative gain.

Benefits of technology

It effectively solves the problems of sparse user behavior data and cold start, improves the accuracy and precision of the recommendation system, generates more reasonable user-item representations, and enhances the accuracy of recommendations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115269977B_ABST
    Figure CN115269977B_ABST
Patent Text Reader

Abstract

This invention discloses a recommendation method based on graph neural networks that fuses knowledge and collaborative information, belonging to the field of recommendation algorithm technology. The method includes the following steps: vector initialization; obtaining item embedding vectors and user embedding vectors containing knowledge information through a knowledge information graph neural network at the information propagation layer; obtaining item embedding vectors and user embedding vectors containing collaborative information through a collaborative information graph neural network at the information propagation layer; calculating the fused user and item embedding vectors at the information fusion layer; calculating the predicted preference scores for all positive and negative samples; constructing the loss function of the recommendation method and calculating the loss; updating the model parameters using the Adam optimization algorithm and the set learning rate; calculating the predicted preference scores for all uninteracted items by the user and sorting and outputting the top K items; and evaluating the recommendation method using metrics. This invention overcomes the problems of sparse user behavior data and cold start, further improving recommendation accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of recommendation algorithm technology, and in particular to a recommendation method based on graph neural networks that integrates knowledge and collaborative information. Background Technology

[0002] With the rapid development of internet applications, information is exploding, and information search methods can no longer meet users' needs for information filtering. Various information service platforms face the enormous challenge of filtering massive amounts of complex information based on users' different characteristics, preferences, and scenarios. Recommendation systems, using artificial intelligence algorithms at their core to mine user item information, have become an effective solution to this challenge. The richness of recommendation scenarios presents different challenges for recommendation systems, but the primary problem they must solve is the accuracy of recommendations. Recommendation systems need to accurately predict users' preferences for items, information, etc. In traditional recommendation systems, collaborative filtering algorithms have achieved good results by collaboratively integrating the behavior of other users to make recommendations. However, in many application scenarios, user behavior data is sparse, and new items have little or no user interaction data (the so-called cold start problem). For example, some inactive users on social media have very little interaction information, and newly updated items on e-commerce platforms have very little purchase and browsing information. These problems are the main obstacles to improving the accuracy of collaborative filtering recommendation algorithms.

[0003] Therefore, a recommendation method is needed to address the data sparsity and cold start problems faced by recommendation algorithms and improve recommendation accuracy. Summary of the Invention

[0004] The technical problem to be solved by this invention is to provide a recommendation method based on graph neural networks that integrates knowledge and collaborative information. By introducing auxiliary information into the recommendation system, the recommendation method makes recommendations by utilizing similar auxiliary information, which makes up for the problems of sparse user behavior data and cold start, and further improves the accuracy of recommendations.

[0005] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:

[0006] A recommendation method based on graph neural networks that integrates knowledge and collaborative information includes the following steps:

[0007] S1. Initialize the user embedding vector, the item embedding vector, the non-item entity embedding vector in the knowledge graph, and the relation embedding vector in the knowledge graph;

[0008] S2. At the information propagation layer, the knowledge information graph neural network is used to obtain the item embedding vector and user embedding vector containing knowledge information;

[0009] S3. At the information propagation layer, the item embedding vector and user embedding vector containing collaborative information are obtained through the collaborative information graph neural network.

[0010] S4. Calculate the fused user and item embedding vectors at the information fusion layer;

[0011] S5. Calculate the predicted preference scores for all positive and negative samples;

[0012] S6. Construct the loss function for the recommendation method and calculate the loss;

[0013] S7. Update the model parameters using the Adam optimization algorithm and the set learning rate δ;

[0014] S8. Calculate the predicted preference scores for all items that the user has not interacted with, and sort and output the top K items.

[0015] S9. The recommended method is evaluated using two metrics: the recall rate of the top K items and the normalized cumulative gain of the loss.

[0016] A further improvement to the technical solution of the present invention is that S2 specifically includes the following steps:

[0017] S21. At the information propagation layer, the knowledge information graph neural network is used to obtain the item embedding vector e containing knowledge information. i The formula is as follows:

[0018]

[0019] Among them, ⊙ represents the Hadamarda complex. It is the set of user neighbors of an item, e v It is the embedding vector of non-item entities in the knowledge graph, e r is the relation embedding vector in the knowledge graph; r represents the relation; KG represents knowledge information; k represents the order of the graph neural network; i represents the item; v represents the entity; The item representation vector represents the output of a k+1 order graph neural network containing knowledge information;

[0020] S22. At the information propagation layer, a user embedding vector e containing knowledge information is obtained through a knowledge information graph neural network. u The formula is as follows:

[0021]

[0022] in, It is the set of the user's item neighbors; u represents the user.

[0023] A further improvement to the technical solution of the present invention is that S3 specifically includes the following steps:

[0024] S31. After passing through the collaborative information graph neural network at the information propagation layer, the item embedding vector containing collaborative information is obtained, as shown in the following formula:

[0025]

[0026] In this context, UI represents collaborative information; This represents a k+1 order item representation vector containing collaborative information;

[0027] S32. After passing through the collaborative information graph neural network at the information propagation layer, the item embedding vector containing collaborative information is obtained, as shown in the following formula:

[0028]

[0029] in, This represents a k+1 order user representation vector containing collaborative information.

[0030] A further improvement to the technical solution of the present invention is that S4 specifically includes the following steps:

[0031] S41. Calculate the fused user embedding vectors for each layer in the information fusion layer;

[0032] S41 specifically includes the following steps:

[0033] S411. Calculate the attention weight of knowledge information, using the following formula:

[0034]

[0035] Where α() represents the attention function; This represents the user representation vector output by the k+1 order graphical neural network; exp() represents the exponential function operation.

[0036] S412. Calculate the attention weights for collaborative information, using the following formula:

[0037]

[0038] S413. Calculate the fused user embedding vectors for each layer, using the following formula:

[0039]

[0040] S42. Calculate the fused item embedding vectors for each layer in the information fusion layer;

[0041] S42 specifically includes the following steps:

[0042] S421. Calculate the attention weight of knowledge information using the following formula:

[0043]

[0044] in, This represents the item representation vector output by the k+1 order graph neural network.

[0045] S422. Calculate the attention weights for collaborative information, using the following formula:

[0046]

[0047] S423. Calculate the item embedding vectors of each layer after fusion, using the following formula:

[0048]

[0049] S43. The user embedding vector summed from each layer is calculated at the information fusion layer, using the following formula:

[0050]

[0051] in, This represents the final user representation vector;

[0052] S44. The item embedding vector obtained by summing the values ​​of each layer in the information fusion layer is calculated using the following formula:

[0053]

[0054] in, This represents the final item representation vector.

[0055] A further improvement to the technical solution of the present invention is that S5 specifically includes the following steps:

[0056] S51. Calculate the preference score for positive samples using the following formula:

[0057]

[0058] Where T represents the vector transpose operation; This represents the preference score of user u for item i, as output by the model.

[0059] S52. Calculate the preference score for negative samples;

[0060] S52 specifically includes the following steps:

[0061] S521. Randomly select items that the user has not interacted with to form negative samples;

[0062] S522. Calculate the preference score for negative samples using the following formula:

[0063]

[0064] A further improvement to the technical solution of the present invention is that S6 specifically includes the following steps:

[0065] S61. Construct the formula for calculating BPR loss as follows:

[0066]

[0067] in, σ represents the BPR loss; O represents the sample set; σ is the sigmoid function; ln is the logarithmic function with base e;

[0068] S62. Construct the formula for calculating the overall loss, as follows:

[0069]

[0070] in, λ is the final loss; λ1 is the regularization coefficient; Θ is all the trainable parameters of the model.

[0071] A further improvement to the technical solution of the present invention is that S9 specifically includes the following steps:

[0072] S91. Calculate the recall rate Recall@K using the following formula:

[0073]

[0074] In this context, TP indicates that the item was recommended and the user interacted with it, meaning that the recommended item was exactly what the user liked; FN indicates that the item was not recommended but the user interacted with it, meaning that no item the user liked was identified.

[0075] S92. Calculate the normalized cumulative loss gain NDCG@K using the following formula:

[0076]

[0077]

[0078] Where r(i) refers to the relevance score of the item at position i in the recommendation list, and IDCG@K is the ideal cumulative gain, that is, all items in the recommendation list are items that the user actually interacts with.

[0079] A further improvement to the technical solution of the present invention is that the value of K is 20.

[0080] The technological advancement achieved by this invention due to the adoption of the above technical solution is: (Inventive Point)

[0081] 1. This invention achieves the technical effect of separating the interference between the two types of information and generating a more reasonable representation of user items by setting up a dual-channel graph neural network to learn knowledge information and collaborative information in the recommendation data respectively.

[0082] 2. This invention achieves the technical effect of more accurately representing users' true interests and item attributes and improving recommendation accuracy by setting up an information fusion mechanism based on attention mechanism to fuse user item representations containing knowledge information and collaborative information. Attached Figure Description

[0083] Figure 1 This is an overall framework diagram of the present invention. Detailed Implementation

[0084] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments:

[0085] like Figure 1 As shown, a recommendation method based on graph neural networks that integrates knowledge and collaborative information includes the following steps:

[0086] S1. Initialize the user embedding vector, the item embedding vector, the non-item entity embedding vector in the knowledge graph, and the relation embedding vector in the knowledge graph;

[0087] S2. At the information propagation layer, the knowledge information graph neural network is used to obtain the item embedding vector and user embedding vector containing knowledge information;

[0088] The specific process of S2 is as follows:

[0089] S21. At the information propagation layer, the knowledge information graph neural network is used to obtain the item embedding vector e containing knowledge information. i The formula is as follows:

[0090]

[0091] Among them, ⊙ represents the Hadamarda complex. It is the set of user neighbors of an item, e v It is the embedding vector of non-item entities in the knowledge graph, e r is the relation embedding vector in the knowledge graph; r represents the relation; KG represents knowledge information; k represents the order of the graph neural network; i represents the item; v represents the entity; The item representation vector represents the output of a k+1 order graph neural network containing knowledge information;

[0092] S22. At the information propagation layer, a user embedding vector e containing knowledge information is obtained through a knowledge information graph neural network. u The formula is as follows:

[0093]

[0094] in, It is the user's set of item neighbors; u represents the user;

[0095] S3. At the information propagation layer, the item embedding vector and user embedding vector containing collaborative information are obtained through the collaborative information graph neural network.

[0096] The specific process of S3 is as follows:

[0097] S31. After passing through the collaborative information graph neural network at the information propagation layer, the item embedding vector containing collaborative information is obtained, as shown in the following formula:

[0098]

[0099] In this context, UI represents collaborative information; This represents a k+1 order item representation vector containing collaborative information;

[0100] S32. After passing through the collaborative information graph neural network at the information propagation layer, the item embedding vector containing collaborative information is obtained, as shown in the following formula:

[0101]

[0102] in, This represents a k+1 order user representation vector containing collaborative information;

[0103] S4. Calculate the fused user and item embedding vectors at the information fusion layer;

[0104] The specific process of S4 is as follows:

[0105] S41. Calculate the fused user embedding vectors for each layer in the information fusion layer;

[0106] The specific process of S41 is as follows:

[0107] S411. Calculate the attention weight of knowledge information, using the following formula:

[0108]

[0109] Where α() represents the attention function; This represents the user representation vector output by the k+1 order graphical neural network; exp() represents the exponential function operation.

[0110] S412. Calculate the attention weights for collaborative information, using the following formula:

[0111]

[0112] S413. Calculate the fused user embedding vectors for each layer, using the following formula:

[0113]

[0114] S42. Calculate the fused item embedding vectors for each layer in the information fusion layer;

[0115] The specific process of S42 is as follows:

[0116] S421. Calculate the attention weight of knowledge information using the following formula:

[0117]

[0118] in, This represents the item representation vector output by the k+1 order graph neural network.

[0119] S422. Calculate the attention weights for collaborative information, using the following formula:

[0120]

[0121] S423. Calculate the item embedding vectors of each layer after fusion, using the following formula:

[0122]

[0123] S43. The user embedding vector summed from each layer is calculated at the information fusion layer, using the following formula:

[0124]

[0125] in, This represents the final user representation vector;

[0126] S44. The item embedding vector obtained by summing the values ​​of each layer in the information fusion layer is calculated using the following formula:

[0127]

[0128] in, Represents the final item representation vector;

[0129] S5. Calculate the predicted preference scores for all positive and negative samples;

[0130] The specific process of S5 is as follows:

[0131] S51. Calculate the preference score for positive samples using the following formula:

[0132]

[0133] Where T represents the vector transpose operation; This represents the preference score of user u for item i, as output by the model.

[0134] S52. Calculate the preference score for negative samples;

[0135] The specific process of S52 is as follows:

[0136] S521. Randomly select items that the user has not interacted with to form negative samples;

[0137] S522. Calculate the preference score for negative samples using the following formula:

[0138]

[0139] S6. Construct the loss function for the recommendation method and calculate the loss;

[0140] The specific process of S6 is as follows:

[0141] S61. Construct the formula for calculating BPR loss as follows:

[0142]

[0143] in, σ represents the BPR loss; O represents the sample set; σ is the sigmoid function; ln is the logarithmic function with base e;

[0144] S62. Construct the formula for calculating the overall loss, as follows:

[0145]

[0146] in, λ is the final loss; λ1 is the regularization coefficient; Θ is all the trainable parameters of the model;

[0147] S7. Update the model parameters using the Adam optimization algorithm and the set learning rate δ;

[0148] S8. Calculate the predicted preference scores for all items that the user has not interacted with, and sort and output the top K items.

[0149] S9. The recommendation method is evaluated using two metrics: the recall rate of the top K items and the normalized cumulative gain of the loss.

[0150] The specific process of S9 is as follows:

[0151] S91. Calculate the recall rate Recall@K using the following formula:

[0152]

[0153] In this context, TP indicates that the item was recommended and the user interacted with it, meaning that the recommended item was exactly what the user liked; FN indicates that the item was not recommended but the user interacted with it, meaning that no item the user liked was identified.

[0154] S92. Calculate the normalized cumulative loss gain NDCG@K using the following formula:

[0155]

[0156]

[0157] Where r(i) refers to the relevance score of the item at position i in the recommendation list, and IDCG@K is the ideal cumulative gain, that is, all items in the recommendation list are items that the user actually interacts with.

[0158] In general, K is set to 20.

[0159] Figure 1 middle, This represents the vector dot product.

[0160] In summary, this invention overcomes the problems of sparse user behavior data and cold start, further improving recommendation accuracy.

Claims

1. A recommendation method based on a graph neural network that fuses knowledge and collaborative information, characterized in that: Comprise the following steps: S1, initialize user embedding vector, item embedding vector, non-item entity embedding vector in knowledge graph and relation embedding vector in knowledge graph; S2, get item embedding vector and user embedding vector containing knowledge information through knowledge information graph neural network in information propagation layer; Specifically comprising the following steps: S21, obtaining an item embedding vector containing knowledge information through a knowledge information graph neural network at the information propagation layer , the formula is as follows: ; wherein, is a Hadamard product, is a set of user neighbors of the item, is an embedding vector of a non-item entity in a knowledge graph, is an embedding vector of a relation in a knowledge graph; represents a relation; KG represents knowledge information; represents the order of a graph neural network; represents an item; represents an entity; represents a knowledge information containing an item representation vector output by the order graph neural network; S22, obtaining a user embedding vector containing knowledge information through a knowledge information graph neural network at the information propagation layer The formula is as follows: ; wherein, is a set of item neighbors of the user; represents the user; S3, get item embedding vector and user embedding vector containing collaborative information through collaborative information graph neural network in information propagation layer; S4, calculate the fused user and item embedding vector in information fusion layer; S5, calculate the prediction preference score of all positive and negative samples; S6, construct the loss function of the recommendation method, and calculate the loss; S7, using Adam optimization algorithm and set learning rate performing model parameter update; S8, calculate the prediction preference score of all non-interaction items of the user, and sort and output the top K items; S9, evaluate the recommendation method by the recall rate of the top K items and the normalized loss cumulative gain index.

2. The recommendation method based on the graph neural network and fusing knowledge and collaborative information according to claim 1, characterized in that: S3 specifically comprises the following steps: S31, get item embedding vector containing collaborative information through collaborative information graph neural network in information propagation layer, the formula is as follows: ; wherein UI represents the collaborative information; represents the collaborative information item representation vector; S32, get item embedding vector containing collaborative information through collaborative information graph neural network in information propagation layer, the formula is as follows: ; wherein, represents a k+1 order user representation vector containing the synergy information.

3. The recommendation method based on the graph neural network and fusing knowledge and collaborative information according to claim 1, characterized in that: S4 specifically comprises the following steps: S41, calculate the fused user embedding vector of each layer in information fusion layer; S41 specifically comprises the following steps: S411, calculate the attention weight of knowledge information, the formula is as follows: ; wherein, denotes an attention function; denotes a user representation vector output by the k+1 order graph neural network; denotes an exponential function operation; S412, calculate the attention weight of collaborative information, the formula is as follows: ; S413, calculate the fused user embedding vector of each layer, the formula is as follows: ; S42, calculate the fused item embedding vector of each layer in information fusion layer; S42 specifically comprises the following steps: S421, calculate the attention weight of knowledge information, the formula is as follows: ; wherein, an item representation vector representing the output of the k+1 order graph neural network; S422, calculate the attention weight of collaborative information, the formula is as follows: ; S423, calculate the fused item embedding vector of each layer, the formula is as follows: ; S43, calculate the user embedding vector of each layer in information fusion layer, the formula is as follows: ; wherein, represents the final user representation vector; S44, calculate the item embedding vector of each layer in information fusion layer, the formula is as follows: ; wherein, representing an item of final representation vector.

4. The recommendation method based on the graph neural network and fusing knowledge and collaborative information according to claim 1, characterized in that: S5 specifically comprises the following steps: S51, calculate the preference score of positive samples, the formula is as follows: ; where T represents vector transpose operation; represents the preference score of user u for item i output by the model; represents the final user representation vector; represents the final representation vector of item i; S52, calculate the preference score of negative samples; S52 specifically comprises the following steps: S521, randomly select non-interaction items of the user to form negative samples; S522, calculate the preference score of negative samples, the formula is as follows: ; where, represents the preference score of user u for item j output by the model; represents the final representation vector of item j.

5. The recommendation method based on the graph neural network and fusing knowledge and collaborative information according to claim 4, characterized in that: S6 specifically comprises the following steps: S61, construct and calculate BPR loss, the formula is as follows: ; wherein, represents the BPR loss; represents the sample set; is a sigmoid function; is a logarithm function with base is a logarithm function with base S62, construct and calculate the overall loss, the formula is as follows: ; wherein, is the final loss; is a regularization coefficient; are all trainable parameters of the model.

6. The recommendation method based on the graph neural network and fusing knowledge and collaborative information according to claim 1, characterized in that: S9 specifically comprises the following steps: S91, calculate the recall rate The formula is as follows: ; Wherein, TP is that the item is recommended, and the user also interacts, indicating that the recommended is exactly what the user likes; FN is that the item is not recommended, but the user interacts, indicating that the user's favorite is not recognized; S92, calculating a normalized impairment cumulative gain The formula is as follows: ; ; wherein, is the relevance score of the item at position in the recommendation list, is the ideal discount cumulative gain, i.e. the items in the recommendation list are all the items that the user actually interacted with.

7. The recommendation method based on the graph neural network and fusing knowledge and collaborative information according to claim 1 or 6, characterized in that: The value of K is 20.