Knowledge graph recommendation method based on global and local implicit relationship enhancement
Through the knowledge graph recommendation method enhanced by global and local implicit relationships, the problem of implicit relationships in the existing technology is solved, the accuracy and comprehensiveness of the recommendation system are improved, and user interests and item characteristics can be better captured.
Patent Information
- Application Number
- CN202510434817.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-08
- Publication Date
- 2025-07-18
AI Technical Summary
The existing knowledge graph recommendation method fails to fully explore implicit relationships, especially ignores the local explicit relationship and the implicit relationship in the user-item interaction graph, resulting in insufficient recommendation accuracy.
Through the knowledge graph recommendation method based on global and local implicit relationship enhancement, the global and local implicit relationships in the knowledge graph are mined, combined with multiple implicit relationships in the interactive graph, and the user and item embedding representation is improved using cross-channel and cross-layer comparison learning, and hierarchical gated fusion multi-group embedding is used for recommendation.
It improves the accuracy and comprehensiveness of recommendations, can better capture the specific interests of users and the detailed characteristics of items, and enhances the performance of the recommendation system.
Smart Images

Figure CN120338071A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of knowledge graph recommendation, and in particular to a knowledge graph recommendation method based on global and local implicit relationship enhancement. Background Art
[0002] As an information filtering tool, recommendation system has become an important way to obtain information, products and services. Recommendation methods based on knowledge graphs can improve collaborative filtering performance and have made some progress. However, existing methods mainly rely on two graphs: item attributes and user interactions. They learn the representations of users and items through the given relationships in the graphs to recommend items preferred by users. These methods regard the relationships given in the graph as explicit connections between nodes, and aggregate and learn the representations of users and items based on such explicit connections. However, the explicit relationships in the knowledge graph cannot fully represent the connections between the nodes in the graph, and some implicit relationships are not fully explored. As shown in the attached figure, Figure 1 As shown in the figure, the three relations "material", "style" and "color" in the triples (cotton coat, material, cotton), (short sleeves, style, round neck), and (sweater, color, white) all describe the attributes of items. Therefore, they can be replaced with the implicit relation "attribute" to mine deep global information between entities, enhance the information flow between entities, and make entity embedding more accurate. Therefore, some researchers regard the existing relations in the knowledge graph as local explicit relations, and mine higher-order global implicit relations from them to enhance the representation of items. Compared with previous methods, this method better mines the node connections in the item attribute graph, thereby learning better item representation. However, this method still has the following problems: (1) Only the global implicit relation knowledge graph is used, while the local explicit relation knowledge graph is ignored, and the correlation between the two is ignored. This leads to the loss of local details and the inaccuracy of global relations. The global implicit relation may tell us that the user likes action movies, while the local explicit relation indicates that the user likes a specific action movie. Ignoring the correlation between the two will cause the model to only recommend action movies based on generalized preferences, while ignoring the user's interest in specific movies. (2) The user-item interaction graph contains a variety of implicit relationships, including user-user, user-item, item-item, etc., but the implicit relationships among them have not been fully explored. For example, there are implicit relationships between users who interact with the same item and have similar interests, implicit relationships between users and items that have not interacted with similar user interests, and implicit relationships between items with similar attributes.
[0003] In order to more comprehensively utilize the implicit relationships in item attribute graphs and interaction graphs, the present invention proposes a knowledge graph recommendation method based on global and local implicit relationship enhancement. Summary of the invention
[0004] The present invention provides a knowledge graph recommendation method based on enhancing global and local implicit relationships, which aims to mine and synergistically utilize the global and local relationships in the knowledge graph and the user-item interaction graph to enhance the representations of users and items, thereby achieving more accurate recommendations.
[0005] The knowledge graph recommendation method based on enhancing global and local implicit relationships provided by the present invention includes the following steps:
[0006] S1. Mine the global and local implicit relationships in the knowledge graph based on the knowledge graph implicit relationship alignment module, and synergistically utilize the global and local relationships to more comprehensively learn the item representation;
[0007] S2. Based on the contrast enhancement module for interaction implicit relationships, remove the noise in the user-item representation learning, and mine various implicit relationships in the interaction graph, including local and global implicit relationships, and improve the accuracy of the user-item embedding representation by combining cross-channel contrast learning and cross-layer contrast learning;
[0008] S3. The fusion prediction module adaptively fuses multiple groups of user and item embeddings through hierarchical gating to obtain the final user and item embeddings for recommendation.
[0009] Preferably, the knowledge graph implicit relationship alignment module is implemented through the following steps:
[0010] S1.1. Calculate the importance scores of all triples in the knowledge graph, and perform masking or deletion operations on the top-k and least-k relationship connections to generate a local explicit relationship knowledge graph after filtering out irrelevant information;
[0011] S1.2. Cluster the explicit relationships to obtain a global implicit relationship knowledge graph;
[0012] S1.3. Align the entity embeddings under the global and local relationship knowledge graphs to make full use of the advantages of both and enhance the accuracy of the entity embeddings.
[0013] Preferably, in step S1.3, the global implicit relationship entity embedding emphasizes the extensive relationship connections between entities, while the local relationship entity embedding focuses on specific local features.
[0014] Preferably, the contrast enhancement module for interaction implicit relationships is implemented through the following steps:
[0015] S2.1. Regarding the noise problem, use SVD to initially remove the noise in the user-item representation learning;
[0016] S2.2. Regarding the data missing or noise problem in the user-item interaction graph, construct a global implicit relationship interaction graph and a local implicit relationship interaction graph;
[0017] S2.3. Aiming at the connection between global and local implicit relationships, we use cross-channel contrastive learning and cross-layer contrastive learning to bring the embeddings between implicit interaction graphs and within each layer of the graph closer, thereby improving the accuracy of user and item embeddings.
[0018] Preferably, the fusion prediction module includes:
[0019] Hierarchical gated fusion module, which is used to automatically fuse multiple sets of user-item embeddings. The user-item embeddings of the global implicit relationship knowledge graph are regarded as the main embeddings, while the user-item embeddings learned through the global and local implicit relationship interaction graphs are used as auxiliary embeddings, which enhances the nonlinear ability of embedding fusion and enables the model to more flexibly capture the complex relationships between different embeddings.
[0020] The prediction module is used to calculate the inner product between the fused user and item embeddings, obtain the likelihood score of the interaction between the user and the item for recommendation, and make recommendations based on the likelihood score of the interaction to provide personalized recommendations for users.
[0021] Preferably, in step S1.1, the step of calculating the importance score of the triplet includes:
[0022] S1.1.1. Calculate the importance scores of head entities, tail entities, and relations using embedding representations and trainable parameter matrices.
[0023] S1.1.2. Ensure comparability of importance scores within the same head entity by multiplying them by the number of neighboring nodes connected to the head entity.
[0024] Preferably, in step 1.2, the step of clustering explicit relationships includes:
[0025] S1.2.1. Replace explicit relations with corresponding implicit relations to obtain a global implicit relation knowledge graph;
[0026] S1.2.2. Split the implicit relationship knowledge graph into multiple subgraphs according to different implicit relationships, and each subgraph only contains triples of this type of implicit relationship.
[0027] Preferably, in step S2.2, the step of constructing a global implicit relationship interaction graph and a local implicit relationship interaction graph includes:
[0028] S2.2.1. Aggregate neighbor node information by similarity and calculate the local implicit relationship adjacency matrix and the global implicit relationship adjacency matrix of users and items;
[0029] S2.2.2. Information is transferred on the local implicit adjacency matrix and the global implicit adjacency matrix to obtain the local implicit embedding and global implicit embedding of users and items.
[0030] Preferably, in step 2.3, the cross-channel contrastive learning and cross-layer contrastive learning steps include:
[0031] S2.3.1. Use the embedding of the same node between different layers as a positive pair and the embedding of different nodes between different layers as a negative sample pair for comparative learning.
[0032] S2.3.2. Perform cross-channel comparative learning on the user-item embeddings obtained from the global and local implicit relationship interaction graphs to bring the embeddings of the same nodes under different views closer.
[0033] Compared with related technologies, the knowledge graph recommendation method based on global and local implicit relationship enhancement provided by the present invention has the following beneficial effects:
[0034] (1) The present invention proposes an implicit relationship alignment module based on the knowledge graph, which mines the global and local implicit relationships that are ignored in the knowledge graph, and coordinates the global and local relationships to learn more comprehensive object representation.
[0035] (2) This paper proposes a contrast enhancement module based on interactive implicit relations, which removes noise in user-item representation learning and mines multiple implicit relations in the interaction graph, including local and global implicit relations. Combining cross-channel contrast learning and cross-layer contrast learning improves the accuracy of user-item embedding representation. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 It is an item attribute graph and interaction graph with explicit and implicit relationships (where the explicit relationship is the original relationship connection in the graph, and the implicit relationship is the deep relationship connection graph between nodes obtained by mining the explicit relationship information);
[0037] Figure 2 The overall model diagram of the knowledge graph recommendation method based on global and local implicit relationship enhancement proposed by the present invention;
[0038] Figure 3 It is a diagram of the hierarchical gating fusion module in the present invention;
[0039] Figure 4 is the influence diagram of the neighbor hyperparameters in the present invention;
[0040] Figure 5 It is the influence diagram of clustering hyperparameters in the present invention;
[0041] Figure 6 It is a graph showing the percentage reduction of different noise ratios in the present invention;
[0042] Figure 7 It is a performance diagram under different density groups in the present invention;
[0043] Figure 8 Influence diagram for different fusion methods in the present invention Detailed implementation manners
[0044] The present invention will be further described below in conjunction with the accompanying drawings and implementation manners
[0045] 1. Knowledge Graph Recommendation Method Based on Enhancement of Global and Local Implicit Relationships
[0046] Since there are implicit relationships in both the knowledge graph and the user-item interaction graph, the present invention proposes a knowledge graph recommendation method based on enhancement of global and local implicit relationships (GLIR4Rec). As Figure 2 shown, this method includes three modules: (1) Knowledge Graph Implicit Relationship Alignment Module; (2) Contrast Enhancement Module Based on Interaction Implicit Relationships; (3) Fusion Prediction Module
[0047] First, the symbols in the present invention need to be described
[0048] Given a knowledge graph KG and a user-item interaction graph G (u,i) , the goal of the task is to learn the representations of users and items based on the two provided graphs, and obtain the interaction possibility scores between users and items according to the model to recommend the items preferred by users
[0049] The interaction graph data includes a user set composed of M users where u i represents the i-th user, and an item set I = {i1, i2, i3,..., i n}, where i j represents the j-th item; the interaction matrix is an m×n matrix that records the interaction information between users and items, and y ij indicates whether there is an interaction between user u i and item i j . When there is an interaction between the user and the item, y ij = 1, otherwise y ij = 0. In this way, the user-item bipartite graph can be represented as G (u,i) = {(u, i)|r ij = 1}
[0050] The triples in the knowledge graph are represented as (h, r, t), where h represents the head entity, t represents the tail entity, and r represents the relationship between the head entity and the tail entity. Use to represent the knowledge graph, where ε represents the entity set, represents the relationship set. Through Align items with entities in the knowledge graph to facilitate the representation of items using entities in the knowledge graph.
[0051] 1.1 Implicit Relation Alignment Module Based on Knowledge Graph
[0052] Traditional methods only focus on the global implicit relationship knowledge graph, while ignoring the local relationship knowledge graph and the connection between them. This leads to the loss of local information, insufficient information utilization in the user-item embedding learning process, and inaccurate embedding representation. Therefore, the present invention proposes an implicit relationship alignment module based on the knowledge graph to make full use of local relationship and global implicit relationship information and mine the information association between the two.
[0053] Not all auxiliary knowledge provided by the knowledge graph is related to user interests, and the different relations and tail entities connected to the head entity in the knowledge graph are not equally important for downstream tasks. Therefore, the present invention calculates the importance scores of all triples in the knowledge graph, and masks or deletes the top-k and least-k relational connections to generate a local explicit relational knowledge graph after irrelevant information is filtered out. A global implicit relational knowledge graph is constructed by clustering explicit relations, and entity embeddings under global and local relations are learned simultaneously, where global implicit relational entity embedding emphasizes extensive relational connections between entities, while local relational entity embedding focuses on specific local features. By aligning global and local entity embeddings through knowledge alignment, the advantages of both can be fully utilized to enhance the accuracy of entity embeddings.
[0054] In the present invention, according to KGRec ] The importance of heterogeneous relations is described in the following way: The importance score S of each triple is calculated as follows (h,r,t) :
[0055]
[0056] where e h ,e t ,e r are the embedding representations of the head and tail entities and relations respectively, is the trainable parameter matrix, and d is the dimension of the hidden vector. (h,r,t) Represents the importance of the relationship and tail entity in modeling user interests, guided by the label of the recommendation task. In order to ensure the comparability of importance scores within the same head entity, a softmax calculation is performed on it to obtain an updated important new score:
[0057]
[0058] Among them, r′ and t′ represent the tail entity and relationship connected to the head entity h. Since the number of neighbors of different head entities is different, the scores can only be compared within the same entity. Therefore, multiply the score by the number of neighbor nodes connected to the head entity to ensure the comparability of scores between different head entities.
[0059] S (h,r,t) =|N h |·S (h,r,t) (3)
[0060] To reduce the influence of irrelevant connections, delete the least-k relationship connections among them, and then perform a masking operation on the top-k score connections for subsequent reconstruction operations. In this way, the local explicit knowledge graph KG after filtering out irrelevant knowledge is obtained. lex :
[0061]
[0062] To construct the global implicit relationship knowledge graph, by clustering the explicit relationships, the set of implicit relationships after clustering is C = {c1, c2,..., c n}, where the number of clustering clusters n is a hyperparameter, so as to select different numbers of clustering clusters according to different data. Replace the explicit relationship r k ∈c k with the corresponding implicit relationship to obtain the global implicit relationship knowledge graph KG gim ={(h, c, t)|h, t ∈ ε, c ∈ C}.
[0063] To better obtain the independent semantic information of each implicit relationship, split the implicit relationship knowledge graph KG gim into multiple subgraphs according to different implicit relationships. Each subgraph only contains the triple of this type of implicit relationship, and each subgraph can be expressed as Aggregate neighbor node information through similarity:
[0064]
[0065] Among them are the embeddings of the head entity and the tail entity respectively, and N k (h) represents the neighbor nodes connected to the head entity in the k-th subgraph. The result of multiplying the embeddings represents the similarity degree between the neighbor and the head entity. Aggregate the information of neighbor nodes according to the similarity degree, that is, the more important the neighbor, the more information is aggregated.
[0066] Obtain the temporary embedding representation of the entity by adding the neighbor information and the entity embedding Then normalize the embedding The above information aggregation method can be organized as:
[0067]
[0068] To better aggregate neighbor information, q iterations are performed in the manner of Formula 6 to obtain the entity embedding representation of the first layer. Formula 7 represents q times of information aggregation for first-order neighbors, where q is a hyperparameter.
[0069]
[0070] After q aggregations, the first-layer representation of entity h on the k-th subgraph is obtained The first-layer entity embeddings on the k subgraphs are fused through an attention mechanism to obtain the first-layer entity embedding To fuse the information of higher-order neighbors, the above process is performed l times. The information convolution process for each layer is as follows:
[0071]
[0072] After l-layer information aggregation, the entity embedding representation of the l+1 layer is obtained And average summation is performed to obtain e gim , to represent the global implicit entity embedding. Use egim to reconstruct the KG lex knowledge graph and calculate its reconstruction loss, forcing the obtained entity embeddings to restore the important triple connection information that has been masked. The specific loss formula is expressed as:
[0073]
[0074] where e h , e r , e t are the head entity, relation, and tail entity embeddings in the global implicit relational knowledge graph respectively. σ(·) represents the sigmoid activation function.
[0075] To incorporate the information in the knowledge graph into the interaction graph, the same aggregation method is also used on the user-item interaction graph G (u,i) . Taking user u as an example, the process of obtaining the user embedding representation for each layer is as follows:
[0076]
[0077] Through average summation of the l+1 layer of user embedding representations ugim is obtained. Then, the local explicit knowledge graph KG lex is subjected to R-GCN convolution to obtain the local explicit entity embedding E lex = RGCN(KG lex ), in order to better utilize both the global E gim and the local relational entity embedding Elex , the present invention adopts the knowledge alignment method to bring the two sets of embeddings closer, so that the embeddings between similar entities can transfer more information, while maintaining the detailed features of the local relationship, making the aligned embedding representation richer. In order to effectively achieve knowledge alignment, the model guides the alignment training direction by calculating the mean square error between the two embedding matrix representations. The alignment process can be expressed as:
[0078] Z lex =E lex ·W
[0079] Z gim =E gim ·W (11)
[0080]
[0081] in, is the learnable parameter matrix, d is the dimension of the hidden vector, N is the number of items, and They are the embedded representations of item i in the local and global relational knowledge graphs, respectively.
[0082] 1.2 Contrast Enhancement Module Based on Interactive Implicit Relationship
[0083] Compared with the implicit relations in the knowledge graph, the implicit information in the user-item interaction graph is more complex and changeable. First, users are prone to make operations such as accidental touches when interacting with items, which makes the graph contain noise. Secondly, there are missing data in the user-item interaction graph, and there is a lack of sufficient data to learn user features. Finally, there is a connection between local implicit relations and global implicit relations. Therefore, the present invention proposes a contrast enhancement module based on interactive implicit relations.
[0084] (1)Regarding the noise problem, the present invention uses SVD to initially remove the noise in the user-item representation learning. Since SVD usually only retains the largest singular values related to the main components of the matrix, it can effectively remove the noise in the embedded representation. (2)Regarding the problems of data missing or noise in the user-item interaction graph, a global implicit relationship interaction graph and a local implicit relationship interaction graph are proposed. (3)Regarding the connection between the global and local implicit relationships, a contrastive learning enhanced by the local and global implicit interaction graphs is proposed. Among them, the local implicit interaction graph maintains the local collaboration signal by considering the connections between top-k user-items, item-users, user-users, and item-items, while the global implicit relationship interaction graph maintains the global collaboration signal by considering the similarity connections of all user-item pairs. By further introducing contrastive learning between the global and local implicit relationship interaction graphs, including cross-channel contrastive learning between different views of the global and local implicit relationships, and cross-layer contrastive learning between the embeddings of each layer in the graph, the embedded representation learning process is enhanced.
[0085] To improve the model efficiency while ensuring accuracy, the present invention uses random SVD to approximately replace the standard SVD, and the embedding process of user items is represented as follows:
[0086]
[0087] where q is the rank of the decomposed matrix, is the normalized adjacency matrix, are used to represent the user embedding matrix, the singular value diagonal matrix, and the item embedding matrix respectively. By reconstructing the global implicit relationship interaction matrix of user items, the generated global implicit interaction matrix not only considers the different similarity interactions of all user-item pairs, but also expands the interaction data of user items and mines the global implicit collaboration signal. On the global implicit relationship interaction matrix message passing is performed to obtain the global implicit embedding of user items for each layer.
[0088]
[0089] Taking the average of the user embeddings of different layers to obtain the global user implicit embedding representation The global implicit embedding of items G i is obtained in the same way.
[0090] The above data augmentation method only considers the global implicit relationship between users and items, and also ignores the local implicit information between user-user and item-item. Although these correlations can be revealed through multi-layer message passing, recent research has shown that long-distance information transmission can generate new learning problems, resulting in non-optimal representations. Therefore, the present invention mines the local implicit relationships between user-item, item-user, user-user, and item-item.
[0091] For the local implicit relationship between users and items, the present invention generates the top-k similar item (user) neighbors for a user (item). The selection of the number of neighbors is controlled by the hyperparameter U k This ensures that the number of neighbors for all nodes is the same, and also ensures the balance of interaction data, that is, the original interaction data with a large amount is denoised, while the users with less interaction data are enhanced. The process of generating neighbor nodes is to calculate the similarity scores between nodes and select the top-k similar nodes. Taking a certain user as an example, the process of selecting its neighbors is as follows:
[0092]
[0093] where u q and v q are the user embedding and item embedding obtained through formula 13 respectively. For items, the process of generating neighbors is the same, and its hyperparameter is controlled by I k Through the above method, the adjacency matrix of the local implicit relationship between user-item is obtained and the adjacency matrix of the local implicit relationship between item-user
[0094] For user-user and item-item, the similarity neighbors of a user represent the users with the same interests as it, and the similarity neighbors of an item represent the similarity of attributes between items. Taking a certain user as an example, the process of selecting its UU k similar neighbors is as follows:
[0095]
[0096] where U q is the user embedding obtained through formula 13. For items, the process of generating neighbors is also the same, and the number of neighbors is controlled by the hyperparameter II k Then the adjacency matrix of the local implicit relationship between user-user is obtained and the adjacency matrix of the local implicit relationship between item-item The final local implicit adjacency matrix Perform information transmission on the local implicit adjacency matrix:
[0097]
[0098] Among them is a randomly initialized embedding matrix, represents the Laplacian matrix of the bipartite graph, D represents the degree matrix, and by averaging the multi-layer embedding matrices, E = E (0) + E (1) + … + E (N) the final local implicit embeddings of users and items are obtained, and then split to obtain the embeddings of users and items E u , E i = Split(E).
[0099] The embeddings of users and items in the global and local implicit relationship interaction graphs are obtained through two implicit relationships. Inspired by CGCL, the embeddings of users and items obtained after graph convolution are related between different layers. Therefore, contrastive learning is performed on the embeddings between different layers. Similarly, contrastive learning on the same node embeddings under different local implicit relationships can capture multi-level node information and enhance the embedding representation ability. Thus, the present invention performs cross-channel and cross-layer contrastive learning on the user-item embeddings obtained from the global and local implicit relationship interaction graphs respectively.
[0100] For cross-layer contrastive learning, the same node embeddings between different layers are used as positive pairs, and different node embeddings between different layers are used as negative sample pairs for contrastive learning, pulling closer the embeddings of the same node in different layers and moving the embeddings of different nodes away. Taking a user u as an example, the specific contrast process is as follows:
[0101]
[0102] where (i, j) = {(0, 1), (1, 2), (0, 2)}, sim(·) represents the cosine similarity, and τ is the temperature parameter. The cross-layer contrastive learning for items is also carried out in the same way, and the specific process is as follows:
[0103]
[0104] where (p, q) = {(0, 1), (1, 2), (0, 2)}, and the final cross-layer contrast loss α is a hyperparameter used to control the influence of different node sides on cross-layer contrastive learning.
[0105] For the local and global implicit relationship enhanced interaction graphs, cross-channel contrastive learning is carried out to pull closer the same node embeddings under different views. Contrastive learning between the two views enhances the robustness of node representation. The specific contrast method is as follows:
[0106]
[0107] where g v, e v They are the embeddings of the nodes on the global and local implicit relationship interaction graphs respectively, and the cross-channel contrast learning loss β is a hyperparameter used to control the influence of different information sides on cross-channel contrast learning. The final loss of the contrast learning enhancement module based on the interaction implicit relationship can be expressed as:
[0108] L ecl = γ1L layer + γ2L channel , (21)
[0109] where γ1 and γ2 are hyperparameters that control the weights of the two contrast learning methods.
[0110] 1.3 Fusion Prediction Module
[0111] To better fuse multiple groups of user-item embeddings for recommendation, a fusion and prediction module is proposed, which mainly includes a hierarchical gating fusion module and a prediction module.
[0112] Through graph convolution on the global implicit relationship knowledge graph and the global and local implicit relationship interaction graphs of users and items, multiple groups of user-item embedding matrices are obtained. The present invention adopts Figure 3 the hierarchical gating method shown in the figure to perform fusion. By integrating embedding information layer by layer, it can more effectively enhance the feature expression ability and capture complex interactions and non-linear relationships. For user embeddings, taking U gim as the main embedding matrix, respectively fusing the two pairs of embedding matrices of U gim , E u and U gim , G u , and then performing the same fusion operation on the two fused embedding matrices. The specific fusion process is as follows.
[0113]
[0114] U gcn is the final output user matrix embedding of the model. For the item embedding matrix, the same fusion method is used to hierarchically fuse E gim , E i , G i to finally obtain I gcn . The possibility score of the interaction between users and items is obtained by calculating the inner product between users and items for prediction.
[0115] 1.4 Model Optimization
[0116] To train the model, the BPR loss, the loss of the interaction graph implicit relationship contrast learning, the triple reconstruction loss, and the knowledge alignment loss are used as the total model loss for training. The specific representation of the loss is as follows:
[0117]
[0118] Among them, λ1, λ2, and λ3 control the weights of different losses respectively.
[0119] Next, the present invention will be further analyzed through experiments.
[0120] 2 Experiments
[0121] 2.1 Datasets
[0122] The model is experimented on two public datasets. Among them, Last.FM is a dataset of a music recommendation system, which is usually used for research on recommendation systems, machine learning, and data mining. It contains users' music listening records and related data. The Movie-1M dataset is one of the most commonly used datasets in movie recommendation systems. It contains 1 million movie rating records and is used for research on recommendation systems and collaborative filtering algorithms. Microsoft Satori is used to match items with the head entities of all triples to construct the knowledge graph of each dataset. The specific data statistics are shown in detail in Table 1. For each dataset, 80% of the positive interaction data is randomly selected for training, and the remaining is used as the test set.
[0123] Table 1. Dataset Statistics
[0124]
[0125]
[0126] 2.2 Comparative Models
[0127] The GLIR4Rec model proposed by the present invention is compared with the following baselines.
[0128] NFM: Performs low-order feature interactions, improves feature crossing ability, and uses neural networks to improve FM.
[0129] CKE: Fuses knowledge graph structure knowledge, text knowledge, visual knowledge, and interaction information into the final item embedding.
[0130] KGAT: Fuses information of different neighbor nodes in the knowledge graph according to different weights through an attention mechanism.
[0131] KGTN: Models the global user intention through a graph Transformer and uses a contrastive learning method for denoising.
[0132] KGIN: Models the user intention and aggregates the knowledge graph information into the user-item embedding vector through different intentions.
[0133] VRKG4Rec: Build a virtual relationship knowledge graph, aggregate information for each relationship, and integrate the information into the user-item interaction.
[0134] Mutual.
[0135] 2.3 Parameter Settings
[0136] The code of the model runs in the PyTorch environment. The parameters for knowledge graph masking in the model are set to 256 and 64 respectively. The parameters for generating neighbors between user-item, item-user, user-user, and item-item are 7, 7, 7, and 5 respectively, and the number of implicit relationships in the knowledge graph is 4 and 5 respectively. Among them, the hyperparameters α and β are set to 0.5, the embedding dimension d in the model is 64, and the Adam optimizer is used for optimization. The training batch size is 2048, and a total of 1000 epochs are iterated, and the best result is selected.
[0137] Table 2 Overall Experiments of the Model (The best experimental results are marked in bold, and the sub-optimal ones are marked with an underline)
[0138]
[0139] 2.4 Analysis of Experimental Results
[0140] 2.4.1 Overall Experiments
[0141] This invention conducts experiments in the settings where the recommended lengths are {1, 5, 10, 20}. Table 2 shows the overall performance comparison between the GLIR4Rec model proposed by this invention and other baselines. The experimental effects of the model of this invention are mostly better than those of other baselines on the two datasets.
[0142] Compared with the baselines, the GLIR4Rec proposed by this invention has better performance. Because the model not only considers the influence of uncorrelated entity connections on user preferences, removes irrelevant entity connections, but also mines the connection between the global and local relationship knowledge graphs. Therefore, knowledge alignment is performed between the global implicit relationship and the local relationship entity embedding, making the entity embedding contain local details and at the same time more information transmission is carried out; this invention also constructs a global and local implicit relationship interaction graph, uses cross-layer and cross-channel contrast learning in the global and local implicit relationships, makes the representation learning of user items more accurate and rich, and enhances the performance of the recommendation system through the above methods.
[0143] KGAT and KGIN capture higher-order neighbor information on the explicit knowledge graph by using graph neural networks. However, KGAT considers and differentiates each relationship, so it cannot capture the connection between entities with similar relationships, so its performance is worse than that of CKE.
[0144] KGTN highly depends on the quality of the knowledge graph. Although it takes into account various user intents and brings better results compared to KGAT, if the intent is not properly selected, it may introduce additional noise and instead reduce the model's performance.
[0145] VRKG4Rec improves the information flow between knowledge graph entities by constructing a global implicit relationship knowledge graph. Its effect is most obvious on knowledge graphs with multiple relationships, indicating that mining the deep information between entities can indeed improve the model's performance and reduce the long-tail phenomenon of the knowledge graph. However, it ignores the local explicit relationship knowledge graph, resulting in the loss of local information.
[0146] 2.4.2 Ablation Experiments
[0147] Table 3. Ablation Experiments
[0148]
[0149]
[0150] To test the effectiveness of different modules in the model, the present invention designed multiple ablation experiments for verification, and the specific results are shown in Table 3.
[0151] To test the role of the local relationship knowledge graph, the w / o align model was obtained after removing the knowledge alignment module. The performance of the model decreased significantly, proving the impact of ignoring the local relationship knowledge graph on the recommendation performance. By jointly using the entity embeddings under the global relationship knowledge graph and the local relationship knowledge graph, not only can the richness of the embeddings be increased, but also the embeddings can be made more accurate, which also proves the effectiveness of the knowledge alignment module.
[0152] After removing the knowledge graph masking operation, the performance of the w / o mask model decreased, proving that there are indeed some unimportant relationships and connections with tail entities in the knowledge graph. Removing these connections can reduce the impact of noise in the knowledge graph and enhance the quality of the knowledge graph.
[0153] After removing the contrastive learning of the global and local implicit relationship interaction graphs, that is, including cross-channel and cross-layer contrastive learning, the user-item embeddings obtained from the two implicit relationship interaction graphs are directly fused through hierarchical gating. The different indicators of the w / o ecl model decreased significantly, indicating the importance of mining the implicit relationships in the interaction graphs for learning user-item representations. By performing contrastive learning on different implicit relationship interaction graphs, better embedding representations can be obtained.
[0154] In order to test the impact of different contrastive learning methods on the model, we removed cross-layer w / o layer and cross-channel w / o channel contrastive learning. After removing cross-channel contrastive learning, the model showed a greater decline on both datasets, indicating that using only cross-channel contrastive learning is more helpful than cross-layer contrastive learning; however, cross-layer contrastive learning can obtain better graph embedding, which plays an auxiliary role in cross-channel contrastive learning. Therefore, using both contrastive learning methods to mine the connection between implicit relationships can better improve the performance of the model.
[0155] 2.4.3 Parameter sensitivity experiment
[0156] The present invention chooses to experiment with two important hyperparameters: the number of neighbors and the number of implicit relationship clustering clusters.
[0157] (1) We conducted experiments on the number of neighbors k with values of {3, 5, 7, 9} and used HR@20 as the evaluation metric to observe the changes in its effects on the two datasets.
[0158] like Figure 4 As shown in the figure, when the number of neighbors between user-item, item-user, user-user, and item-item changes, the effect of the model on the two data sets will gradually increase with the increase of the number of neighbors, indicating that enhancing the connection information between users and items reduces the impact of data sparsity on the model; however, when the number of neighbors increases further, the model effect will decrease, because too many neighbors will bring noise and weaken the embedding representation of the model. Therefore, appropriately enhancing the interaction between users and items can alleviate the problem of sparse interaction data.
[0159] (2) For the number of clusters c The choice of {1, 2, 3, 4, 5} is used for experiments, and HR@20 is used as the evaluation indicator to observe the changes in its effect on the two datasets.
[0160] like Figure 5As shown in the figure, when a smaller number of clustering clusters are selected on the Last.FM dataset, better results can be obtained. The model performance improves as the number of clusters increases, but the model performance decreases when the number further increases, indicating that there are implicit connections between relationships in the knowledge graph of the Last.FM dataset. More implicit information about relationships is mined through clustering, increasing the information transmission between entities. Therefore, the embedding representation learning of items is more accurate. For the Movie-1M dataset, the model performance is the best when the number of clusters is 5. It can be concluded that due to the relatively small number of relationships in the Movie dataset, the implicit information between relationships is also relatively small. Therefore, mining hidden information is beneficial to the model performance. However, if the number of clusters for relationship clustering continues to decrease, more local explicit information between relationships is lost, and the model performance will instead decline. Therefore, different numbers of clustering clusters can be selected for datasets with different characteristics.
[0161] 2.4.4 Denoising Analysis
[0162] To test the effect of the model on denoising irrelevant connection relationships and tail entities in the knowledge graph, the present invention randomly adds connection noises with different proportions (5%, 10%, 15%, 20% respectively) to the knowledge graph to contaminate the auxiliary information in the knowledge graph. Figure 6 Shows the percentage of the model Recall performance decline of the two datasets under different knowledge graph noise proportions.
[0163] The experimental results show that adding irrelevant connection noises to the knowledge graph will reduce the model performance, and the more noises, the more the model performance decreases. In the KGTN model, since no clustering operation is performed on the relationships, the added noisy triples have the most obvious impact on the model performance. The VRKG4Rec model reduces the impact of noisy triples due to the use of virtual relationships. However, the model proposed in the present invention is superior to the VRKG4Rec model in terms of performance decline, indicating that the knowledge graph masking operation has stronger capabilities in identifying irrelevant knowledge and entity connections, thereby enhancing the anti-interference ability of this model to noises. By removing the irrelevant knowledge connections in the knowledge graph, the quality of the knowledge graph is improved, and the embedding representation of items is also more accurate. Therefore, the recommendation performance of the model is improved.
[0164] 2.4.5 Data Augmentation Analysis
[0165] To test the effect of the model on the global and local implicit relationship interaction graphs under different degrees of sparsity of interaction data, the present invention divides all users of the two public datasets, Last-FM and Movie-1M, into 5 groups according to the number of items interacted by users. The density of user interaction gradually increases from G1 to G5, and then the model performance under different groupings is tested.
[0166] By Figure 7As can be seen from the experimental results shown, the performance of all models under the Last-FM dataset gets better as the interaction frequency density increases, indicating that the more user interaction data there is, the better the training effect of the model, and thus the better the performance of the model. The model of the present invention adds edges between user-user, user-item, and item-item, further increasing the training data, so the effect has a certain improvement compared to the model without implicit relationship exploration. In G4 and G5 with a greater data density, the improvement of the model is stronger compared to G1, G2, and G3 with a smaller density, because the user interest preferences are better modeled in the data with a greater density, so the implicit relationship interaction graph constructed is more accurate. The model also has a certain improvement on the Movie-1M dataset, but the user-item interaction frequency is more intensive than that of Last-FM, so there is more noise, which may bring noise information when constructing the implicit relationship interaction graph, so the improvement effect is not as obvious as that of Last-FM.
[0167] Therefore, constructing global and local implicit relationship interaction graphs between different nodes of users and items can improve the performance of the model, and also proves the effectiveness of global and local implicit relationship interaction graphs.
[0168] 2.4.6 Fusion Method
[0169] After obtaining multiple groups of user-item embeddings, it is very important to accurately fuse the embeddings. The method proposed by the present invention regards the user-item embeddings of the global implicit relationship knowledge graph as the main embeddings, while the user-item embeddings learned through the global and local implicit relationship interaction graphs are used as auxiliary embeddings, aiming to further improve the embedding representations of users and items. The hierarchical gating mechanism enhances the non-linear ability of embedding fusion, enabling the model to more flexibly capture the complex relationships between different embeddings.
[0170] To verify the effectiveness of the hierarchical gating fusion module, it is compared with other embedding fusion methods, including average value fusion and concatenated linear fusion. The results shown in Figure 8 are obtained through experiments. Among them, the performance of concatenated linear fusion is the lowest, and the performance of average value fusion has a certain decline compared to the hierarchical gating fusion method proposed by the present invention, demonstrating the advantages of hierarchical gating fusion in the fusion of multiple groups of embeddings. The experimental results show that fusing information from different perspectives can make the embedding representation more accurate and improve the effect of the model. Hierarchical gating fusion can more reasonably integrate multiple groups of embedding information, thereby improving the expression ability and recommendation accuracy of the model.
[0171] In addition, the hierarchical gating fusion module not only considers the relative importance between different embeddings, but also dynamically adjusts the gating weights, enabling the model to adaptively select the most representative embeddings during the fusion process. This approach allows the model to more accurately capture potential user preferences, thus providing more accurate recommendation results.
[0172] Compared with related technologies, the knowledge graph recommendation method based on enhancing global and local implicit relationships provided by the present invention has the following beneficial effects:
[0173] To better mine knowledge graph information, the present invention performs deletion operations on unimportant triple connections, removing entity connections in the knowledge graph that are irrelevant to the recommendation task; and believes that existing methods ignore the deep connections between global and local relationship knowledge graphs and do not consider various implicit relationship information in the interaction graph. Therefore, knowledge alignment is performed on entity embeddings under global and local relationships in the knowledge graph to improve the representation ability of entity embeddings; by constructing a global and local implicit relationship interaction graph, cross-channel contrast learning and cross-layer contrast learning are used to mine various implicit information in the interaction graph, obtaining more accurate and rich user-item embeddings. Finally, hierarchical gating is used for multi-group embedding fusion for recommendation. Experiments on the dataset prove the effectiveness of different modules in the GLIR4Rec model. In future work, more explicit noise reduction methods for the interaction graph will be explored, and better ways to more effectively utilize auxiliary information in the knowledge graph will be explored.
Claims
1. A knowledge graph recommendation method based on enhancing global and local implicit relationships, characterized in that The following steps are involved: S1. Based on the knowledge graph implicit relationship alignment module, we mine the global and local implicit relationships in the knowledge graph and learn the object representation more comprehensively by coordinating the global and local relationships. S2, a contrast enhancement module based on interactive implicit relations, removes noise in user-item representation learning and mines multiple implicit relations in the interaction graph, including local and global implicit relations, and combines cross-channel contrast learning and cross-layer contrast learning to improve the accuracy of user-item embedding representation; S3, the fusion prediction module, adaptively fuses multiple sets of user and item embeddings through hierarchical gating to obtain the final user and item embeddings for recommendation.
2. The knowledge graph recommendation method based on enhancing global and local implicit relationships according to claim 1, wherein, The knowledge graph-based implicit relationship alignment module is implemented by the following steps: S1.
1. Calculate the importance scores of all triples in the knowledge graph, and cover or delete the top-k and least-k relational connections to generate a local explicit relational knowledge graph after irrelevant information is filtered out. S1.
2. Cluster explicit relations to obtain a global implicit relation knowledge graph; S1.
3. Align the entity embeddings under the global and local relational knowledge graphs to fully utilize the advantages of both and enhance the accuracy of entity embeddings.
3. The knowledge graph recommendation method based on enhancing global and local implicit relationships according to claim 2, wherein In step S1.3, the global implicit relational entity embedding emphasizes the extensive relational connections between entities, while the local relational entity embedding focuses on specific local features.
4. The knowledge graph recommendation method based on enhancing global and local implicit relationships according to claim 1, wherein The contrast enhancement module based on interactive implicit relationship is implemented by the following steps: S2.
1. To address the noise problem, SVD is used to preliminarily remove the noise in user-item representation learning; S2.
2. In view of the data missing or noise problem in the user-item interaction graph, a global implicit relationship interaction graph and a local implicit relationship interaction graph are constructed; S2.
3. Aiming at the connection between global and local implicit relationships, we use cross-channel contrastive learning and cross-layer contrastive learning to bring the embeddings between implicit interaction graphs and within each layer of the graph closer, thereby improving the accuracy of user and item embeddings.
5. The knowledge graph recommendation method based on enhancing global and local implicit relationships according to claim 1, wherein The fusion prediction module includes: A hierarchical gated fusion module that automatically fuses multiple sets of user-item embeddings, with the user-item embeddings from the global implicit relational knowledge graph as the primary embeddings and the user-item embeddings learned from the global and local implicit relational interaction graphs as the auxiliary embeddings; The prediction module is used to calculate the inner product between the fused user and item embeddings, obtain the likelihood score of the interaction between the user and the item for recommendation, and make recommendations based on the likelihood score of the interaction to provide personalized recommendations for users.
6. The knowledge graph recommendation method based on enhancing global and local implicit relationships according to claim 2, wherein In step S1.1, the step of calculating the importance score of the triplet includes: S1.1.
1. Calculate the importance scores of head entities, tail entities, and relations using embedding representations and trainable parameter matrices. S1.1.
2. Ensure comparability of importance scores within the same head entity by multiplying them by the number of neighboring nodes connected to the head entity.
7. The knowledge graph recommendation method based on enhancing global and local implicit relationships according to claim 2, wherein, In step 1.2, the step of clustering explicit relationships includes: S1.2.
1. Replace explicit relations with corresponding implicit relations to obtain a global implicit relation knowledge graph; S1.2.
2. Split the implicit relationship knowledge graph into multiple subgraphs according to different implicit relationships, and each subgraph only contains triples of this type of implicit relationship.
8. The knowledge graph recommendation method based on enhancing global and local implicit relationships according to claim 4, wherein In step S2.2, the steps of constructing a global implicit relationship interaction graph and a local implicit relationship interaction graph include: S2.2.
1. Aggregate neighbor node information by similarity and calculate the local implicit relationship adjacency matrix and the global implicit relationship adjacency matrix of users and items; S2.2.
2. Information is transferred on the local implicit adjacency matrix and the global implicit adjacency matrix to obtain the local implicit embedding and global implicit embedding of users and items.
9. The knowledge graph recommendation method based on enhancing global and local implicit relationships according to claim 4, wherein In step 2.3, the cross-channel contrastive learning and cross-layer contrastive learning steps include: S2.3.
1. Use the embedding of the same node between different layers as a positive pair and the embedding of different nodes between different layers as a negative sample pair for comparative learning. S2.3.
2. Perform cross-channel comparative learning on the user-item embeddings obtained from the global and local implicit relationship interaction graphs to bring the embeddings of the same nodes under different views closer.
Citation Information
Cited By
Knowledge base-based reasoning comparison method
CN121119142A