Graph neural network recommendation method based on fusion enhancement of knowledge graph and social graph
By integrating the knowledge graph and social graph in the graph neural network, combined with the multi-layer perceptron and attention mechanism, the problem of failing to consider social influence and resource correlation in the existing technology is solved, and a more accurate and delicate recommendation effect is achieved. .
Patent Information
- Application Number
- CN202410742759.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-09-24
AI Technical Summary
Existing recommendation methods based on graph neural networks fail to fully consider the social influence of users and the correlation between resources, resulting in poor recommendation results.
Adopt a graph neural network recommendation method based on the fusion of knowledge graph and social graph, through node coding, feature fusion, propagation iteration, splicing synthesis and dynamic weight fusion mechanism, combined with multi-layer perceptron and attention mechanism, to build a network between users, projects and entities. The complex relationship between them, dynamically adjust the weights to improve recommendation accuracy.
Significantly improving the accuracy and detail of the recommendation system, it can better capture the user's true preferences and the attractiveness of the project, and achieve more accurate and detailed recommendation effects.
Smart Images

Figure CN118690850A
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of graph neural network recommendation systems, and in particular to a graph neural network recommendation method based on the fusion enhancement of knowledge graph and social graph. Background Art
[0002] In the era of explosive growth of Internet information, massive amounts of information are pouring into people's lives. As a tool to filter out information of interest to users from the complex information, the recommendation system has been widely used in e-commerce, social media, Internet advertising, and question-answering services. It can help users make reasonable choices and decisions, improve the efficiency of data processing, and effectively alleviate the problem of information explosion. At present, traditional recommendation algorithms include collaborative filtering, content-based recommendations, etc. However, due to the problem of data sparsity, recommendations based on users' weaker related information become impossible. Therefore, scholars have tried to adopt deep learning methods.
[0003] In recent years, the rise of deep learning technology has provided a new perspective for solving the above problems. As an important branch of artificial intelligence research, deep learning can capture deeper and more abstract data features by constructing multi-level neural networks. Among them, graph neural networks (GNNs) are widely used to build personalized recommendation systems due to their outstanding ability to handle complex relationships between nodes. By iteratively aggregating the information of the target node and its neighboring nodes, GNN can effectively extract the deep feature representation of each node. Although GNN has achieved remarkable results in social network analysis, bioinformatics and other fields. However, most recommendation methods based on graph neural networks still have two problems:
[0004] (1) Failure to consider the social impact of users;
[0005] (2) The correlation between resources is not considered.
[0006] Social influence refers to the use of interactive behavior data and social relationships between users to build a personalized model that reflects the social interests of users, and based on this model to achieve customized content or service recommendations for different users. Knowledge graphs contain a large number of entities and their relationships, which can provide richer and more comprehensive information for recommendation systems. By integrating this information into graph neural networks, the model can better understand projects, users, and the complex relationships between them.
[0007] Therefore, this paper proposes a graph neural network recommendation method based on the fusion enhancement of knowledge graph and social graph. By extracting high-order semantic information from the three graphs, it helps to capture the true preferences of each user and the attractiveness of each item. Summary of the invention
[0008] The present invention aims to overcome the above-mentioned shortcomings of the prior art and provide a graph neural network recommendation method based on the fusion enhancement of knowledge graph and social graph.
[0009] A graph neural network recommendation method for knowledge graph and social graph fusion enhancement includes the following steps:
[0010] Step 1, Node Encoding: The initial embedding layer is dedicated to encoding user, item, and entity nodes. By preprocessing the attribute information of users, items, and entities and applying embedding techniques, these attributes are converted into vector representations in a high-dimensional space.
[0011] Step 2: Feature fusion: Fusion of features from different sources to enhance the representation ability of the model.
[0012] Step 3: Propagation iteration: Through the multi-layer structure of the graph neural network, effective information propagation and iterative update are achieved. In each layer, the representation of the node will be updated according to the information of its neighboring nodes. Through multiple rounds of iterations, each node can indirectly obtain and integrate more extensive network information.
[0013] Step 4: splicing and synthesis: Integrate and splice the node representations after multiple rounds of iterative updates to form a comprehensive feature representation.
[0014] Step 5: Dynamic weight fusion mechanism: By dynamically adjusting the weight ratio between the social graph and the knowledge graph, ensure that the model can be flexibly adjusted according to different scenarios to achieve the best recommendation effect.
[0015] Step 6, Rating prediction and optimization: The dot product of user and item embeddings is used as the final rating, and the BPR loss function is used to optimize the user-item rating matrix through Bayesian maximum a posteriori probability.
[0016] Furthermore, in the step 1, the node encoding includes:
[0017] Convert input data into low-dimensional embedding vectors and, Corresponding to users, items, and entities respectively. These embedding vectors are then represented by embedding matrices, P, Q, and O. By integrating the dimensions of P, Q, and O, a three-dimensional space can be constructed. The relationship between users, items, and entities in the three-dimensional relationship of the present invention is depicted as follows Figure 2 shown.
[0018] Furthermore, in the step 2, the feature fusion includes:
[0019] The vector is input into the fusion layer. For each user a, the fusion layer embeds the user’s vector p a The eigenvector x associated with ita Combined, it produces
[0020]
[0021] Where W a is a transformation matrix and g(x) is a nonlinear transformation function.
[0022] In the same way, for each item i, the item embedding is its inherent latent vector q i and its eigenvector y i The function is as follows:
[0023]
[0024] Will Mapping onto the PQ plane, we get Likewise, when mapped onto the QO plane, the result is
[0025] Finally, for entities associated with a project, the model construction can be expressed as follows:
[0026]
[0027] Furthermore, in step 3, the propagation iteration includes:
[0028] In every k+1 iterations, the user embeddings labeled by the kth layer Project Embed and entity embedding The propagation layer continuously refines the embedding through the propagation function to produce and This recursive process starts from k=0 and ends when a predetermined depth K is reached.
[0029] Considering item i and its embedding at layer k According to the interest graph G I Construct the subsequent embedding of the next layer k+1 as follows:
[0030]
[0031] Here, I i represents the set of users who provide ratings for item i, is the embedding of user a at the kth layer. The aggregation weight is given by Indicates that each item's update is embedded in Combines the aggregated neighbor embedding with the previous layer embedding of the items.
[0032] The process is similar for enhancing embeddings via knowledge graphs.
[0033]
[0034] Simple average pooling fails to take into account the different importance of user interests in item representation. Therefore, an attention mechanism is used to calculate the weight η ia , and,η if , using the following attention function:
[0035]
[0036] The attention network uses a multi-layer perceptron (MLP) to determine the importance of node connections based on the user and item embeddings at the kth layer. The attention weights are then normalized as follows:
[0037]
[0038] The exponential function ensures the non-negativity of the attention weights. Using the exponential function ensures that each calculated attention weight is greater than zero.
[0039] For each user a, their latent representation at layer k is given by Symbolization. For social structure G S and interest graph G I , the user’s embedding at layer k+1 Absorbing the influence of these two networks: in G S The influence of the diffusion within and in G I The spread of interest within. encapsulates a composite embedding from social proximity, while The embeddings based on the central interest of the items are aggregated in the subsequent layers. Therefore, the evolution of each user embedding is expressed as follows:
[0040]
[0041] Calculated by and,
[0042]
[0043] in and, Respectively represent the scores reflecting social and interest influences, calculated as follows:
[0044]
[0045]
[0046] After calculating the attention weights for specific nodes, these are fed into the graph attention framework, allowing the formation of graph attention weights as follows:
[0047]
[0048] In the enhancement phase involving the knowledge graph, the entity embedding updated at layer k+1 is previously embedded The result of the weighted sum of the two components: a refined knowledge representation and interest-driven entity representation It is expressed as:
[0049]
[0050] in Aggregating the impact from knowledge aspects, the calculation is as follows:
[0051]
[0052] and Taking into account the influence of user interests, the following is determined:
[0053]
[0054] The attention weights are learned separately through a dedicated multi-layer perceptron and, For knowledge graph and user interests:
[0055]
[0056] The entity embedding is conditioned by the attention coefficient and, Guidance, formulated as follows:
[0057]
[0058] Furthermore, in the step 4, the splicing synthesis includes:
[0059] After the K-level propagation process, the embeddings of users and items are collected and given by, and, At all levels up to,k={0,1,2,...,K}, it is represented. For each user, construct This merges her representations at each level as their cumulative embedding. Within the framework of the knowledge graph, the final item embedding is formulated as Similarly, for entities, construct as their cumulative embedding. Within the framework of the knowledge graph, the final item embedding is formulated as Thus, the concatenation layer enables the synthesis of a feature set that reflects social and knowledge graph enhancements:
[0060]
[0061]
[0062] Furthermore, in step 5, the dynamic weight fusion mechanism includes:
[0063] Eigenvector, The weight coefficient,λ,is formulated through the convolution operation, which promotes the dynamic link between,UV,and,TV,. The specific formula is expressed as
[0064]
[0065]
[0066] in, represents the upsampling process, which is implemented by linear interpolation, and x i , represents the feature map of the i-th layer.
[0067] The workflow of the dynamic weight fusion mechanism is as follows: Figure 3 Shown
[0068] Furthermore, in step 6, the score prediction and optimization includes:
[0069] The prediction score is then determined by taking the dot product of the final user and item embeddings:
[0070]
[0071] The optimization method of utilizes a pairwise ranking loss function, which is favored in scenarios involving implicit feedback data.
[0072]
[0073] Among them, I + represents the set of positive instances (known user-item interactions), and I - , represents negative instances (unobserved user-item pairs, hence sampled from set I). Function,σ(x) represents the sigmoid activation function, and Θ,contains the parameters to be optimized. The coefficient,ρ,is introduced as a regularization term to suppress overfitting by penalizing large parameter values. All parameters in this loss function apply differential properties.
[0074] The parameters are initialized using a normal distribution with mean zero and standard deviation 0.01. The embedding dimensions within the convolutional layer are maintained uniformly to avoid any intentional modification. The architecture of the multi-level attention mechanism consists of a two-layer MLP.
[0075] The present invention integrates the interaction information between users and projects, the social connection information between users and users, and the knowledge graph information of projects into a unified representation, and constructs non-graph structured information into graph information. It first starts with generating the initial embedding, merges features through a fusion layer, and then refines these features in continuous propagation layers. The present invention designs an innovative adaptive weighting mechanism to dynamically balance the influence of social graph and knowledge graph enhanced features, and finally completes the recommendation in a prediction layer. Through experimental verification on multiple data sets, the present invention shows significant advantages over the existing technology in improving the accuracy and sophistication of the recommendation system, and successfully achieves an efficient balance between social recommendations and knowledge-driven recommendations, thus paving the way for more accurate and sophisticated recommendation systems.
[0076] The present invention has the following beneficial effects:
[0077] 1. A new method for graph neural network-based recommendation systems is proposed, which integrates user-item interaction information, user-user social connection information and item-entity knowledge graph into a unified representation, and improves the recommendation quality through a multi-faceted approach.
[0078] 2. A large number of experiments on public datasets demonstrate the effectiveness and interpretability of the proposed method in understanding the importance of complex relationships.
[0079] In addition to the above-described purposes, features and advantages, the present invention has other purposes, features and advantages. The present invention will be further described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0080] Figure 1 It is a flow chart of the present invention.
[0081] Figure 2 It is a depiction of the relationships between users, items and entities in the three-dimensional relationship of the present invention, and decomposes it into two-dimensional representations: user-item interaction graph, user-user social graph and item-entity knowledge graph.
[0082] Figure 3 It is a workflow diagram of the dynamic fusion weight mechanism in the present invention. DETAILED DESCRIPTION
[0083] Reference will now be made in detail to exemplary embodiments of the present disclosure, examples of which are illustrated in the accompanying drawings. The same component symbols represent the same or similar parts in the drawings and description. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0084] In view of the problems existing in the prior art, the present invention provides a graph neural network recommendation method based on the fusion enhancement of knowledge graph and social graph. The present invention is described in detail below with reference to the accompanying drawings.
[0085] like Figure 1 As shown, the graph neural network recommendation method for enhancing the fusion of knowledge graph and social graph provided by the embodiment of the present invention includes the following steps:
[0086] Step 1: First, define two core objects: user set U = {u 1 ,u 2 , ..., u m}, where m = |U|, and the set of items V = {v 1 , v 2 , ..., v n}, where n = |V|. Each user u i ∈U is represented as an attribute vector including age, preferences, and other demographic details. Similarly, each item v j ∈V is characterized by an attribute vector that details features such as type, price, and other relevant characteristics. Subsequently, the attributes of certain items can be abstracted from the entity and represented as edge information. Thus, an entity set T = t 1 , t 2 , ..., t 1 , where l = |T|.
[0087] Convert input data into low-dimensional embedding vectors and, Corresponding to users, items, and entities respectively. These embedding vectors are then represented by embedding matrices, P, Q, and O. By integrating the dimensions of P, Q, and O, a three-dimensional space can be constructed. The relationship between users, items, and entities in the three-dimensional relationship of the present invention is depicted as follows Figure 2 Based on these definitions, the formula of the method is elaborated in detail.
[0088] Step 2: Input the vector into the fusion layer. For each user a, the fusion layer embeds the user’s vector p a The eigenvector x associated with it a Combined, it produces
[0089]
[0090] Where W a is a transformation matrix and g(x) is a nonlinear transformation function.
[0091] In the same way, for each item i, the item embedding is its inherent latent vector q i and its eigenvector y i The function is as follows:
[0092]
[0093] Will Mapping onto the PQ plane, we get Likewise, when mapped onto the QO plane, the result is
[0094] Finally, for entities associated with a project, the model construction can be expressed as follows:
[0095]
[0096] Step 3: In every k+1 iterations, the user embeddings marked by the kth layer are Project Embed and entity embedding The propagation layer continuously refines the embedding through the propagation function to produce and, This recursive process starts from k=0 and ends when a predetermined depth K is reached.
[0097] Considering item i and its embedding at layer k According to the interest graph G I Construct the subsequent embedding of the next layer k+1 as follows:
[0098]
[0099] Here, I i represents the set of users who provide ratings for item i, is the embedding of user a at the kth layer. The aggregation weight is given by Indicates that each item's update is embedded in Combines the aggregated neighbor embedding with the previous layer embedding of the items.
[0100] The process is similar for enhancing embeddings via knowledge graphs.
[0101]
[0102] Simple average pooling fails to take into account the different importance of user interests in item representation. Therefore, an attention mechanism is used to calculate the weight η ia , and,η if , using the following attention function:
[0103]
[0104] The attention network uses a multi-layer perceptron (MLP) to determine the importance of node connections based on the user and item embeddings at the kth layer. The attention weights are then normalized as follows:
[0105]
[0106] The exponential function ensures the non-negativity of the attention weights. Using the exponential function ensures that each calculated attention weight is greater than zero.
[0107] For each user a, their latent representation at layer k is given by Symbolization. For social structure G S and interest graph G I , the user’s embedding at layer k+1 Absorbing the influence of these two networks: in G S The influence of the diffusion within and in G I The spread of interest within. encapsulates a composite embedding from social proximity, while The embeddings based on the central interest of the items are aggregated in the subsequent layers. Therefore, the evolution of each user embedding is expressed as follows:
[0108]
[0109] Calculated by and,
[0110]
[0111] in and, Respectively represent the scores reflecting social and interest influences, calculated as follows:
[0112]
[0113] After calculating the attention weights for specific nodes, these are fed into the graph attention framework, allowing the formation of graph attention weights as follows:
[0114]
[0115] In the enhancement phase involving the knowledge graph, the entity embedding updated at layer k+1 is previously embedded The result of the weighted sum of the two components: a refined knowledge representation and interest-driven entity representation It is expressed as:
[0116]
[0117] in Aggregating the impact from knowledge aspects, the calculation is as follows:
[0118]
[0119] and Taking into account the influence of user interests, the following is determined:
[0120]
[0121] The attention weights are learned separately through a dedicated multi-layer perceptron and, For knowledge graph and user interests:
[0122]
[0123] The entity embedding is conditioned by the attention coefficient and, Guidance, formulated as follows:
[0124]
[0125] Step 4: After the K-level propagation process, the embeddings of users and items are collected, respectively, and, At all levels up to k = {0, 1, 2, ..., K}. For each user, construct This merges her representations at each level as their cumulative embedding. In the framework of the knowledge graph, the final item embedding is formulated as, Similarly, for entities, construct, as their cumulative embedding. Within the framework of the knowledge graph, the final item embedding is formulated as Thus, the concatenation layer enables the synthesis of a feature set that reflects social and knowledge graph enhancements:
[0126]
[0127]
[0128] Step 5, feature vector, The weight coefficient,λ,is formulated through the convolution operation, which promotes the dynamic link between,UV,and,TV,. The specific formula is expressed as
[0129]
[0130]
[0131] in, represents the upsampling process, which is implemented by linear interpolation, and x i , represents the feature map of the i-th layer.
[0132] The workflow of the dynamic weight fusion mechanism is as follows: Figure 3 Shown
[0133] In step 6, the prediction score is then determined by taking the dot product of the final user and item embeddings:
[0134]
[0135] The optimization method of utilizes a pairwise ranking loss function, which is favored in scenarios involving implicit feedback data.
[0136]
[0137] Among them, I + represents the set of positive instances (known user-item interactions), and I - , represents negative instances (unobserved user-item pairs, hence sampled from set I). Function,σ(x) represents the sigmoid activation function, and Θ,contains the parameters to be optimized. The coefficient,ρ,is introduced as a regularization term to suppress overfitting by penalizing large parameter values. All parameters in this loss function apply differential properties.
[0138] The parameters are initialized using a normal distribution with mean zero and standard deviation 0.01. The embedding dimensions within the convolutional layer are maintained uniformly to avoid any intentional modification. The architecture of the multi-level attention mechanism consists of a two-layer MLP.
Claims
1. A graph neural network recommendation method based on knowledge graph and social graph fusion enhancement, characterized in that: The graph neural network recommendation method for knowledge graph and social graph fusion enhancement includes the following steps: Step 1, node encoding: The initial embedding layer is dedicated to encoding user, item, and entity nodes; by preprocessing the attribute information of users, items, and entities and applying embedding techniques, these attributes are converted into vector representations in a high-dimensional space; Step 2: Feature fusion: Fusion of features from different sources to enhance the representation capability of the model; Step 3: Propagation and iteration: Through the multi-layer structure of the graph neural network, effective information propagation and iterative update are achieved; in each layer, the representation of the node will be updated according to the information of its neighboring nodes. Through multiple rounds of iterations, each node can indirectly obtain and integrate more extensive network information; Step 4: splicing and synthesis: Integrate and splice the node representations after multiple rounds of iterative updates to form a comprehensive feature representation; Step 5: Dynamic weight fusion mechanism: By dynamically adjusting the weight ratio between the social graph and the knowledge graph, the model can be flexibly adjusted according to different scenarios to achieve the best recommendation effect; Step 6, Rating prediction and optimization: The dot product of user and item embeddings is used as the final rating, and the BPR loss function is used to optimize the user-item rating matrix through Bayesian maximum a posteriori probability.
2. The graph neural network recommendation method based on the fusion enhancement of knowledge graph and social graph according to claim 1 is characterized in that: In step 1, the node encoding includes: Convert input data into low-dimensional embedding vectors and correspond to users, items, and entities respectively; these embedding vectors are then represented by embedding matrices P, Q, and O; and a three-dimensional space is constructed by integrating the dimensions of P, Q, and O.
3. According to claim 1, the graph neural network recommendation method based on the fusion enhancement of knowledge graph and social graph is characterized in that: In step 2, the feature fusion includes: The vector is input into the fusion layer. For each user a, the fusion layer embeds the user’s vector p a The eigenvector x associated with it a Combined, it produces Where W a is a transformation matrix, g(x) is a nonlinear transformation function; For each item i, the fusion layer transforms the item’s embedding vector Its inherent latent vector q i Its eigenvector y i Combined together, it looks like this: Will Mapping onto the PQ plane, we get Likewise, when mapped onto the QO plane, the result is Finally, for entities associated with a project, the model constructs the following representation:
4. The graph neural network recommendation method based on the fusion enhancement of knowledge graph and social graph according to claim 1 is characterized in that: In step 3, the propagation iteration includes: In every k+1 iterations, the user embeddings labeled by the kth layer Project Embed and entity embedding As input; the propagation layer continuously refines the embedding through the propagation function to produce and This recursive process starts from k = 0 and ends when the predetermined depth K is reached; Considering item i and its embedding at layer k According to the interest graph G I Construct the subsequent embedding of the next layer k+1 as follows: Here, I i represents the set of users who provide ratings for item i, is the embedding of user a at the kth layer; the aggregation weight is given by Indicates that each item's update is embedded in Combines aggregated neighbor embeddings with the previous layer embeddings of items; The process is similar for enhancing embeddings through knowledge graphs; Simple average pooling fails to take into account the different importance of user interests in item representation; therefore, an attention mechanism is used to calculate the weight η ia and η if , using the following attention function: The attention network uses a multi-layer perceptron (MLP) to determine the importance of node connections based on the user and item embeddings at the kth layer; the attention weights are then normalized as follows: The exponential function ensures the non-negativity of the attention weights. Using the exponential function ensures that each calculated attention weight is greater than zero. For each user a, their latent representation at layer k is given by Symbolization; for social structure G S and interest graph G I , the user’s embedding at layer k+1 Absorbing the influence of these two networks: in G S The influence of the diffusion within and in G I Propagation of interest within; terminology encapsulates a composite embedding from social proximity, while The embeddings based on the central interest of the items are aggregated in subsequent layers; therefore, the evolution of each user’s embedding is expressed as follows: Calculated by and in and Respectively represent the scores reflecting social and interest influences, calculated as follows: After calculating the attention weights for specific nodes, these are fed into the graph attention framework, allowing the formation of graph attention weights as follows: In the enhancement phase involving the knowledge graph, the entity embedding updated at layer k+1 is previously embedded The result of the weighted sum of the two components: a refined knowledge representation and interest-driven entity representation It is expressed as: in Aggregating the impact from knowledge aspects, the calculation is as follows: and Taking into account the influence of user interests, the following is determined: The attention weights are learned separately through a dedicated multi-layer perceptron and For knowledge graph and user interests: The entity embedding is conditioned by the attention coefficient and Guidance, formulated as follows:
5. According to claim 1, the graph neural network recommendation method based on the fusion enhancement of knowledge graph and social graph is characterized in that: In step 4, the splicing synthesis includes: After the K-level propagation process, the embeddings of users and items are collected, respectively and At all levels up to k = {0, 1, 2, ..., K}, for each user, construct as their cumulative embedding; within the framework of the social graph, the final item embedding is formulated as For each entity, construct as their cumulative embeddings; within the framework of knowledge graphs, the final item embedding is formulated as The connection layer is able to synthesize a set of features that reflect social and knowledge graph enhancements:
6. The graph neural network recommendation method based on the fusion enhancement of knowledge graph and social graph according to claim 1 is characterized in that: In step 5, the dynamic weight fusion includes: Eigenvector The weight coefficient λ is formulated through the convolution operation, which promotes the dynamic link between UV and TV; the specific formula is expressed as in, represents the upsampling process, which is implemented by linear interpolation, and x i Represents the feature map of the i-th layer.
7. The graph neural network recommendation method based on the fusion enhancement of knowledge graph and social graph according to claim 1 is characterized in that: In step six, the rating prediction includes: The prediction score is determined by taking the dot product of the end user and item embeddings: The optimization method uses a pairwise ranking loss function: Among them I + represents the set of positive instances (known user-item interactions), and I - represents negative instances (unobserved user-item pairs, so sampled from set I); the function σ(x) represents the sigmoid activation function, and Θ contains the parameters to be optimized; the coefficient ρ is introduced as a regularization term to suppress overfitting by penalizing large parameter values; all parameters in this loss function apply differential properties; The parameters are initialized using a normal distribution with a mean of zero and a standard deviation of 0.01.
Citation Information
Cited By
Cross-domain recommendation method based on multilayer loop graph convolutional network
CN118897918A
Multi-dimensional fusion meta universe and vertical AI model collaborative innovation platform
CN119443116A
Multi-graph fusion learning-based personalized book recommendation method and system for old-age readers
CN121210777A
Old reader personalized book recommendation method and system based on multi-graph fusion learning
CN121210777B
