A heterogeneous graph recommendation method fusing clustering information
Patent Information
- Application Number
- CN202410392583.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-02
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2044-04-02
AI Technical Summary
[0003]传统的基于协同过滤推荐算法通过将系统中的用户和物品进行参数化,并利用这些嵌入进行点积运算来预测用户对物品的偏好,存在着以下不足:1、协同过滤模型仅仅考虑了用户对物品的交互历史信息,而没有考虑到用户与用户间,或物品与物品间可能存在的深层次的相似性信息,使得其严重依赖丰富的历史数据;2、在面对数据稀疏性问题时,协同过滤模型难以准确地建模出用户与物品的嵌入,从而使得推荐系统性能不能达到最优
[0058]1、本发明提出了一种融合聚类信息的异质图推荐方法,通过构造用户和物品的属性编码来捕获用户和物品属性中的隐含语义,再利用属性编码为用户和物品分别进行聚类,并将聚类后得到的类别信息融入异质图中的用户节点与物品节点,使得本方法能够在冷启动环境下拥有更好的推荐性能。
Smart Images

Figure CN118261250B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence recommendation technology, specifically to a heterogeneous graph recommendation method that integrates clustering information. Background Technology
[0002] In recent years, with the rise of self-media platforms and big data, a deluge of film and television works has emerged. Faced with such a rich and diverse array of information, quickly capturing film and television information that users are interested in has become particularly difficult, leading to the problem of "information overload" and placing a heavy information burden on people. Recommendation systems, as a means of solving the problem of "information overload," can recommend content that users may like by analyzing their historical behavioral information; these are also known as personalized recommendation systems.
[0003] Traditional collaborative filtering-based recommendation algorithms, which parameterize users and items in the system and use these embeddings to perform dot product operations to predict user preferences for items, have the following shortcomings: 1. Collaborative filtering models only consider the historical interaction information between users and items, without taking into account the deep similarity information that may exist between users or between items, making them heavily reliant on rich historical data; 2. When facing the problem of data sparsity, collaborative filtering models struggle to accurately model the embeddings of users and items, thus preventing the recommendation system from achieving optimal performance; 3. In the "cold start" scenario where new users join, the lack of historical interaction information prevents collaborative filtering models from providing effective recommendations for new users.
[0004] Therefore, researching how to delve deeper into users' preferences for items in recommender systems and alleviate the cold start problem of recommender systems is of great practical significance. Summary of the Invention
[0005] The purpose of this invention is to overcome the above-mentioned deficiencies in the prior art and provide a heterogeneous graph recommendation method that integrates clustering information.
[0006] The objective of this invention can be achieved by adopting the following technical solutions:
[0007] A heterogeneous graph recommendation method that incorporates clustering information includes the following steps:
[0008] S1. Train the user attribute encoder and the item attribute encoder to encode the attribute information of users and items respectively, obtain user attribute codes and item attribute codes, and cluster users and items respectively.
[0009] S2. Construct a heterogeneous graph structure using user ratings of items and user attribute codes and item attribute codes;
[0010] S3. Use a graph convolutional network aggregator and a feature-cross-based aggregator to form a heterogeneous graph aggregator, and jointly learn the features of users and items in the heterogeneous graph;
[0011] S4. Based on the user and item features obtained from the heterogeneous graph, calculate and sort the user's predicted ratings for items, and generate a list of recommended items for the user.
[0012] Further, in step S1, the user attribute encoder and item attribute encoder are used to encode user attributes and item attributes into a vector space for characterization, thereby extracting attribute features. Clustering is used to classify users and items according to attribute features, and to utilize category information to enhance the features of user nodes and item nodes, thereby improving the accuracy of recommendation performance. The training process of the user attribute encoder and item attribute encoder, as well as the clustering process of users and items, are as follows:
[0013] S11. Define the user's age, occupation, and hobbies as the user's attribute information. u Define the item's category and production date information as the item's attribute information. v , where a u and a v These are vectors representing real user attributes and item attributes using multi-hot encoding, respectively. The user attribute information and item attribute information are input into a user attribute encoder and an item attribute encoder, respectively, which consist of multiple neural network layers. The user attribute information and item attribute information are encoded as user attribute codes and item attribute codes, respectively. The expressions for the user attribute encoder and the item attribute encoder are as follows:
[0014] z u =enc u (a u ),
[0015] z v =Enc v (a v ),
[0016] Among them, Enc u () and Enc v () represent the user attribute encoder and the item attribute encoder, respectively. Both attribute encoders are trainable. u and z v These represent user attribute codes and item attribute codes, respectively, both with a dimension of d. z ;
[0017] S12. Input the user attribute code and the item attribute code into the user attribute reconstructor and the item attribute reconstructor, which are composed of multiple neural network layers, respectively, to obtain the reconstructed user attribute information and the reconstructed item attribute information. The expressions of the user attribute reconstructor and the item attribute reconstructor are as follows:
[0018]
[0019]
[0020] in and These represent the reconstructed user attribute information and the reconstructed item attribute information, respectively. u () and Dec v () represent the user attribute refactorer and the item attribute refactorer, respectively. Both attribute refactorers are trainable.
[0021] S13. First, calculate the user attribute reconstruction loss. Loss of item attribute reconstruction The expression is:
[0022]
[0023]
[0024] Where ||·|| represents the modulo operation of the vector, and then the score loss is calculated. The expression is:
[0025]
[0026]
[0027] Where |·| represents the absolute value operation, r represents the set of user ratings for an item's history. uv This represents user u's true rating of item v. This represents the predicted rating of user u for item v;
[0028] Next, we calculate the total loss. The expression is:
[0029]
[0030] Where, ω rec The weighting coefficients representing the reconstruction loss;
[0031] Repeat steps S11 through S13, using the total loss. Perform gradient backpropagation to train the attribute encoder and attribute reconstructor until the maximum number of iterations is reached;
[0032] S14. After the user attribute encoder and item attribute encoder are trained, step S11 is executed once to obtain the user attribute encoding matrix Z. u and item attribute encoding matrix Z v Z u and Z v m u ×d z and m v ×d z A two-dimensional matrix, where each row represents the attribute code of a user or item, m u and m v Represent the number of users and the number of items respectively; then Z u and Z v As input, the KMeans clustering algorithm is used to cluster user attribute codes and item attribute codes respectively. The categories to which user attribute codes and item attribute codes are assigned represent the categories to which users and items are assigned, respectively. After clustering, a category number is assigned to each user and item based on their assigned category. The KMeans clustering algorithm is the one used by David Arthur et al. in their 2007 ACM conference paper, "K-means++: tips of careful seeding," which can cluster input vector groups into a specified number of groups based on the similarity between vectors.
[0033] Further, in step S2, the user's rating of the item is constructed into a user-item rating bipartite graph, which is defined as an "interaction subgraph" and described by the following expression: G int =(V u V v E uv ), where V u V represents a user node in the graph. v E represents the item node in the graph. uv Let G represent the edges in the graph. The similarity between users and between items is calculated using the inner product of user attribute codes and item attribute codes, respectively. Then, edges are established between users and between items based on the similarity. Each user is connected to the K most similar users, and each item is connected to the K most similar items. The resulting topological relationship is defined as an "attribute subgraph," described by the following expression: G attr =(V u V v E uu E vv ), where V u V represents a user node in the graph.v E represents the item node in the graph. uu E represents the connection between users. vv Represents the edges between items; the "interaction subgraph" and the "attribute subgraph" together form a heterogeneous graph G = (V u V v E uv E uu E vv ).
[0034] Furthermore, in step S3, since there are different relationships between users and items, users and users, and items and items, using a heterogeneous graph structure to describe the relationships in the data is more realistic. The feature learning process for users and items in a heterogeneous graph is as follows:
[0035] S31. Define the initial preference features of user nodes in a heterogeneous graph as follows: The initial preference characteristics of the item node are: The initial preference features of the nodes are randomly initialized, where the indices u and v represent the corresponding users and items; the initial features of the user category are defined as follows. The initial characteristics of an item category are: The initial features of the categories are randomly initialized, where the subscripts p and q represent the corresponding user category and item category, respectively. Using the category number assigned to each user and item, the initial category features of the user node are obtained from the initial features of the user category and the initial features of the item category, respectively. and After concatenating the initial preference features and initial category features of a node, the initial features of the node are obtained, expressed as:
[0036]
[0037]
[0038] in and These represent the initial characteristics of user nodes and item nodes, respectively, and concat(·) represents the operation of concatenating the characteristics;
[0039] S32. On heterogeneous graphs, graph convolutional network aggregators and feature-cross-based aggregators are used to aggregate information on interaction subgraphs and attribute subgraphs, respectively. The information aggregation process of the aggregator on the interaction subgraph is described as follows:
[0040]
[0041]
[0042] Where, Nu N represents the neighbors on the interaction subgraph of a user node. v The neighbors of an item node on the interaction subgraph, |N u | and |N v | These represent the number of neighbors in the interaction subgraph for user nodes and the number of neighbors in the interaction subgraph for item nodes, respectively. Indicates the aggregation parameter. These represent the user node features and item node features obtained by the heterogeneous graph aggregator after the l-th aggregation, respectively. and These represent the user node features and item node features obtained by the graph convolutional network aggregator after the (l+1)th aggregation on the interactive subgraph, respectively.
[0043] The information aggregation process of the aggregator on the attribute subgraph can be described as follows:
[0044]
[0045]
[0046] Among them, M u M represents the set of homogeneous users formed by the user node's neighbors and the user node itself on the attribute subgraph. v |M represents the set of homogeneous items formed by the neighbors of an item node in the attribute subgraph and the item node itself. u | and | M v | represent the number of nodes in the set of homogeneous users and the set of homogeneous items, respectively. Let i and j represent the user node features and item node features obtained by the heterogeneous graph aggregator after the k-th aggregation, respectively. The subscripts i and j represent the indexes of the node in the set of homogeneous users and the set of homogeneous items, respectively. and ...
[0047] After aggregating the interaction subgraph and attribute subgraph respectively, the features are merged to obtain the result of one aggregation by the heterogeneous graph aggregator, expressed as:
[0048]
[0049]
[0050] and These represent the user node features and item node features obtained by the heterogeneous graph aggregator after the (l+1)th aggregation, respectively.
[0051] Further, in step S4, the user's predicted rating for the item is predicted using an inner product and weighted summation method, and the predicted ratings are sorted to generate a list of recommended items for the user, including:
[0052] Based on the initial node features obtained in step S3 and the node features obtained after multiple aggregations, calculate the inner product of each pair of user features and item features, and then perform a weighted summation. The expression is as follows:
[0053]
[0054]
[0055] in This represents the predicted score calculated using the user node features and item node features obtained after the l-th heterogeneous graph aggregation. The final predicted score is represented by L, which represents the total number of aggregations performed by the heterogeneous graph aggregator.
[0056] Then, the items are sorted according to the user's predicted rating for each item, and a recommendation list for the user is generated based on the sorting results.
[0057] The present invention has the following advantages and effects compared with the prior art:
[0058] 1. This invention proposes a heterogeneous graph recommendation method that integrates clustering information. By constructing attribute codes for users and items, the implicit semantics in user and item attributes are captured. Then, the attribute codes are used to cluster users and items respectively, and the category information obtained after clustering is integrated into user nodes and item nodes in the heterogeneous graph. This enables the method to have better recommendation performance in cold start environments.
[0059] 2. This invention calculates user-user similarity and item-item similarity by using user attribute encoding and item attribute encoding respectively, constructs attribute subgraphs for user-user and item-item, constructs an interaction subgraph for user-item based on users' historical rating behavior of items, and merges the two graphs into a heterogeneous graph, thereby expanding the edges of the graph, enabling this method to have better recommendation performance under extremely sparse data conditions.
[0060] 3. This invention constructs an aggregator based on feature intersection to propagate node features in the attribute subgraph, which can fully explore the feature relationships between neighboring nodes in the attribute subgraph, thereby improving the accuracy of node features and making the recommendation results more accurate. Attached Figure Description
[0061] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0062] Figure 1 This is the overall architecture diagram of the heterogeneous graph recommendation method that integrates clustering information in this invention;
[0063] Figure 2 This is a structural diagram of the attribute encoder in this invention;
[0064] Figure 3 This is a diagram illustrating the construction process of the interactive subgraph in this invention;
[0065] Figure 4 This is a diagram illustrating the construction process of the attribute subgraph in this invention. Detailed Implementation
[0066] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0067] Example 1
[0068] This embodiment uses, as follows Figure 1 The implementation steps shown are followed to disclose the training and recommendation process of the heterogeneous graph neural network. This includes the following steps:
[0069] S1. Train the user attribute encoder and the item attribute encoder to encode the attribute information of users and items respectively, obtain user attribute codes and item attribute codes, and cluster users and items respectively.
[0070] The specific implementation method of step S1 is as follows:
[0071] S11. Use two multi-hot codes to represent user attribute information and item attribute information respectively. Each position of the multi-hot code corresponds to an attribute of the user or item. If the user or item has an attribute, the value of the corresponding position in the multi-hot code is set to 1; otherwise, it is 0. Then, build two three-layer neural networks as user attribute encoders and item attribute encoders respectively. The inputs of the two attribute encoders are ax and a, respectively. v The output consists of two distinct 64-dimensional vectors, representing the user attribute code and the item attribute code, respectively, expressed as:
[0072] zu =enc u (a u ),
[0073] z v =Enc v (a v ),
[0074] Where a u and a v Enc represents the multi-hot encoding of user attributes and item attributes, respectively. u () and Enc v () represent the user attribute encoder and the item attribute encoder, respectively. u and z v These represent user attribute encoding and item attribute encoding, respectively, both of which are 64-dimensional vectors. The encoding processes for user attributes and item attributes are independent of each other and can be executed in parallel.
[0075] S12. Construct two three-layer neural networks, one as the user attribute reconstructor and the other as the item attribute reconstructor, to reconstruct user attributes and item attributes respectively. The process is described as follows:
[0076]
[0077]
[0078] Among them, Dec u () and Dec v () represent the user attribute refactorer and the item attribute refactorer, respectively. and These represent the multi-hot encoding of reconstructed user attributes and the multi-hot encoding of reconstructed item attributes, respectively, with dimensions corresponding to a. u and a v They are the same. The reconstruction processes for user attributes and item attributes are independent of each other and can be executed in parallel.
[0079] S13. Obtain user ratings for items and assign the ratings to triples (u, v, r). uv This indicates that the attribute information of the user and item in the triplet is represented by ) . Then, the attribute information a of the user and item in the triplet is represented by ) u and a v Enter them into Enc respectively u and Enc v In the middle, obtain the corresponding user attribute code z u and item attribute code z v The predicted scores are calculated using the inner product method, and the score loss is calculated using all the predicted scores. The expression is as follows:
[0080]
[0081]
[0082] in This represents the user's predicted rating for the item. |·| represents the absolute value operation. This represents the set of user ratings for items. Next, we calculate the user attribute reconstruction loss and the item attribute reconstruction loss, expressed as:
[0083]
[0084]
[0085] Where ||·|| represents the modulo operation of the vector. and These represent the user attribute reconstruction loss and the item attribute reconstruction loss, respectively. These three losses are independent and can be calculated in parallel. Next, the total loss is calculated, expressed as:
[0086]
[0087] Where ω rec The weighting factor for the reconstruction loss is set to 0.5.
[0088] Repeat steps S11 through S13, using the total loss. The attribute encoder and attribute reconstructor are trained using gradient backpropagation until the number of iterations reaches 5000. The training process of the attribute encoder is as follows: Figure 2 As shown.
[0089] S14. After training is complete, encode all user attributes A u Attribute code A for all items v By inputting the user attribute encoder and the user attribute encoder respectively, the user's attribute encoding matrix Z is obtained. u and Z v Z u and Z v m u ×64 and m v A 2D matrix of size × 64, where each row represents the attribute code of a user or item, m u and m v The numbers represent the number of users and the number of items, respectively. The number of categories for both users and items is set to 20. The KMeans algorithm clusters the user attribute codes and the item attribute codes, respectively. The categories to which the user attribute codes and item attribute codes are assigned represent the categories to which the users and items are assigned, respectively. After clustering, a category number is assigned to each user and item using the categories to which the users and items are assigned.
[0090] S2. Construct a heterogeneous graph structure using user ratings of items and user attribute codes and item attribute codes;
[0091] The specific implementation of step S2 is as follows: First, represent each rating data of the user for the item as a triple (u, v, r). uv A set of triplets R is created, and a hash table Map is built. Each triplet in R is iterated over, and two key-value pairs (Key1, Value1) and (Key2, Value2) are added to the Map in each iteration. The two tuples are then assigned to the Key and Value respectively.
[0092] Key1 = ("user", str(r) uv ),"item"),
[0093] Value1 = (u, v),
[0094] Key2 = ("item", str(r) uv ),"user"),
[0095] Value2 = (v, u),
[0096] Here, "user" and "item" are two strings, representing users and items respectively. str(·) converts numbers into strings. Key1 and Key2 describe the (starting point type, edge type, ending point type), and Value1 and Value2 describe the specific starting point and ending point.
[0097] Next, the inner product is used to calculate the similarity between users and between items using the user attribute encoding and item attribute encoding respectively, resulting in the similarity matrix S. u and S v S u It is m u ×m u A two-dimensional matrix, S v It is m v ×m v A two-dimensional matrix, where each row of the matrix represents the similarity between a user or item and all other users or items, then S... u and S v Set all values on the diagonal of S to 0. Iterate through S. u and S v For each row, calculate the index of the largest of the first 20 values in that row, and add 20 key-value pairs to the Map accordingly. and The keys and values are as follows:
[0098]
[0099]
[0100]
[0101]
[0102] Here, "u2u" and "i2i" are two strings, used to represent the edge types of user-user and item-item, respectively. center and v center This indicates the user and item corresponding to the currently traversed row. and This indicates the user or item corresponding to the i-th largest value in the currently traversed row.
[0103] Then, using the dgl package, the Map is constructed into a weighted and directed heterogeneous graph. The portion of the heterogeneous graph from the scoring data is defined as the "interaction subgraph," and the portion from the attribute encoding is defined as the "attribute subgraph." The generation methods for the interaction subgraph and the attribute subgraph are as follows: Figure 3 and Figure 4 As shown.
[0104] S3. Use a graph convolutional network aggregator and a feature-cross-based aggregator to form a heterogeneous graph aggregator, which together learns the features of users and items in the heterogeneous graph.
[0105] The specific implementation method of step S3 is as follows:
[0106] S31. Randomly initialize a 32-dimensional preference feature for each user node in the heterogeneous graph. The preference features for user nodes and item nodes are denoted as follows: and The subscripts represent the corresponding users and items, respectively; a 32-dimensional initial feature is randomly initialized for each category of users and items, denoted as . and The subscripts represent the corresponding user category and item category, respectively. Then, the category number for each user and item is used to start from... and The initial category features of user nodes and item nodes are obtained in the process. and After concatenating the initial preference features and initial category features of a node, the initial features of the node are obtained, expressed as:
[0107]
[0108]
[0109] in and These represent the initial features of the user node and the item node, respectively. `concat(·)` represents the operation of concatenating these features; after concatenation, and All are 64-dimensional vectors.
[0110] S32. On the interactive subgraph, information aggregation is performed using a graph convolutional network aggregator, expressed as:
[0111]
[0112]
[0113] Where, N u N represents the neighbors on the interaction subgraph of a user node. v The neighbors of an item node on the interaction subgraph, |N u | and |N v | These represent the number of neighbors in the interaction subgraph for user nodes and the number of neighbors in the interaction subgraph for item nodes, respectively. Indicates the aggregation parameter. These represent the user node features and item node features obtained by the heterogeneous graph aggregator after the l-th aggregation, respectively. and These represent the user node features and item node features obtained by the graph convolutional network aggregator after the (l+1)th aggregation on the interactive subgraph, respectively.
[0114] On the attribute subgraph, information aggregation is performed using an aggregator based on feature intersection, expressed as:
[0115]
[0116]
[0117] Where M u M represents the set of homogeneous users formed by the user node's neighbors and the user node itself on the attribute subgraph. v |M represents the set of homogeneous items formed by the neighbors of an item node in the attribute subgraph and the item node itself. u | and | M v | represents the number of nodes in the homogeneous user set and the homogeneous item set, respectively, both of which are set to 20 in this embodiment. Let i and j represent the user node features and item node features obtained by the heterogeneous graph aggregator after the k-th aggregation, respectively. The subscripts i and j represent the indexes of the node in the set of homogeneous users and the set of homogeneous items, respectively. and ...
[0118] After aggregating the interaction subgraph and attribute subgraph respectively, the features are merged to obtain the result of one aggregation by the heterogeneous graph aggregator, expressed as:
[0119]
[0120]
[0121] and Let H represent the user node features and item node features obtained by the heterogeneous graph aggregator after the (l+1)th aggregation, respectively. By aggregating node features three times through three iterations, a multi-layered user node feature vector set H is obtained. u and item multi-layer node feature vector group H v Since no feature dimension mapping process is involved in the aggregation process, the node features of each layer are 64-dimensional.
[0122] S4. Based on the feature vector group H of the multi-layer user nodes u and item node feature vector group H v It calculates and sorts user ratings for items, generating a list of recommended items for the user.
[0123] The specific implementation of step S4 is as follows: For each layer of node features, the score corresponding to that layer of node features is obtained using the inner product, and the scores of each layer are weighted and summed, as expressed by:
[0124]
[0125]
[0126] in This represents the predicted score calculated using the user node features and item node features obtained after the l-th heterogeneous graph aggregation. This represents the final predicted rating; then, based on the user's predicted rating for each item, the items are sorted, and the top 50 items rated by each user are used as the user's recommendation list.
[0127] The common heterogeneous graph recommendation method in this embodiment fully mines the attribute information of nodes and uses the attribute encoding of nodes for clustering, thereby integrating the clustering information into the node features. At the same time, it uses the attribute encoding of nodes to construct attribute subgraphs, which expands the number of edges in the graph. Compared with general graph recommendation methods, this method can achieve good performance under conditions of extremely sparse data and cold start conditions.
[0128] The following provides a comparison of experimental data between this method, referred to here as CIH-GNN, and existing graph recommendation models GC-MC, Star-GCN, and IMC-GAE:
[0129] (1) Simulation data settings:
[0130] The datasets are MovieLens-100K and MovieLens-1M, both of which contain ratings from multiple users for multiple movie projects. MovieLens-100K contains 100,000 ratings from 943 users for 1,682 movies, with a data sparsity of 6.3%; MovieLens-1M contains 1,000,209 ratings from 6,040 users for 3,706 movies, with a data sparsity of 4.47%.
[0131] (2) Performance indicator settings:
[0132] To better simulate the cold start scenario, we divided the dataset as follows: 80% of all users were randomly selected, and all rating data from these users were used to train the model. The remaining 20% of users' rating data were used to test the model's performance under cold start conditions. To evaluate the model's rating prediction effectiveness, we used widely used metrics: RMSE, MAE, and NDCG@K. Lower RMSE and MAE values are better, while higher NDCG@K values are better. In our simulation, K was fixed at 5.
[0133] (3) Simulation parameter settings:
[0134] Simulations were performed using Python. For each method, we trained the model using the parameter settings described in their paper. All methods were run three times on the same device, and the average results are shown in Tables 1 and 2.
[0135] Table 1. Comparison of results of different recommendation methods on MovieLens-100K
[0136] GCMC 1.0384 0.8437 0.7179 Star-GCN 1.0428 0.8596 0.7084 IMC-GAE 1.0459 0.8496 0.7121 CIH-GNN 1.0179 0.8224 0.7291
[0137] Table 2. Comparison of results for different recommendation methods on MovieLens-1M
[0138] GCMC 0.9918 0.7956 0.7554 Star-GCN 0.9772 0.7810 0.7516 IMC-GAE 1.0025 0.8153 0.7573 CIH-GNN 0.9627 0.7725 0.7961
[0139] As shown in Tables 1 and 2, CIH-GNN achieves optimal performance across all recommendation metrics on both datasets. This demonstrates that CIH-GNN improves recommendation accuracy compared to existing models.
[0140] The above embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above embodiments. Any changes, modifications, substitutions, combinations, or simplifications made without departing from the spirit and principle of the present invention shall be considered equivalent substitutions and shall be included within the protection scope of the present invention.
Claims
1. A heterogeneous graph recommendation method that integrates clustering information, characterized in that, The heterogeneous graph recommendation method includes the following steps: S1. Train the user attribute encoder and the item attribute encoder to encode the attribute information of users and items respectively, obtain user attribute codes and item attribute codes, and cluster users and items respectively. S2. Construct a heterogeneous graph structure using user ratings of items and user attribute codes and item attribute codes; S3. A heterogeneous graph aggregator is formed by combining a graph convolutional network aggregator and a feature-cross-based aggregator to jointly learn the features of users and items in the heterogeneous graph; the feature learning process for users and items in the heterogeneous graph is as follows: S31. Define the initial preference features of user nodes in a heterogeneous graph as follows: The initial preference features of the item nodes are And randomly initialize the initial preference features of the nodes, where the subscripts are... and This represents the corresponding user and item; the initial characteristics of the user category are defined as follows. The initial characteristics of the item category are And randomly initialize the initial features of the categories, where the subscripts and These represent the corresponding user category and item category, respectively. Using the category number assigned to each user and item, the initial category features of the user node are obtained from the initial features of the user category and the initial features of the item category, respectively. and After concatenating the initial preference features and initial category features of a node, the initial features of the node are obtained, expressed as: , , in and These represent the initial characteristics of user nodes and item nodes, respectively. This indicates an operation that connects features; S32. On heterogeneous graphs, graph convolutional network aggregators and feature-cross-based aggregators are used to aggregate information on interaction subgraphs and attribute subgraphs, respectively. The information aggregation process of the aggregator on the interaction subgraph is described as follows: , , in, Represents the neighbors on the interaction subgraph of a user node. The neighbors of an item node on the interaction subgraph. and These represent the number of neighbors in the interaction subgraph for user nodes and the number of neighbors in the interaction subgraph for item nodes, respectively. Indicates the aggregation parameter. , These represent the heterogeneous graph aggregator at the th . The user node features and item node features obtained after the second aggregation and These represent the first and second iterations of the graph convolutional network aggregator on the interaction subgraph, respectively. User node features and item node features obtained after the second aggregation; The information aggregation process of the aggregator on the attribute subgraph can be described as follows: , , in This represents the set of homogeneous users formed by the user node's neighbors and the user node itself on the attribute subgraph. This represents the set of homogeneous items formed by the neighbors of an item node in the attribute subgraph and the item node itself. and These represent the number of nodes in the set of homogeneous users and the set of homogeneous items, respectively. , These represent the heterogeneous graph aggregator at the th . The user node features and item node features obtained after the second aggregation, with subscripts and These represent the node's index in the set of homogeneous users and the set of homogeneous items, respectively. and These represent the first and second steps of the feature-cross-based aggregator on the attribute subgraph, respectively. The user node features and item node features obtained after the second aggregation Represents the Hadamard product; After aggregating the interaction subgraph and attribute subgraph respectively, the features are merged to obtain the result of one aggregation by the heterogeneous graph aggregator, expressed as: , , and These represent the heterogeneous graph aggregator at the th . User node features and item node features obtained after the second aggregation; S4. Based on the user and item features obtained from the heterogeneous graph, calculate and sort the user's predicted ratings for items, and generate a list of recommended items for the user.
2. The heterogeneous graph recommendation method that integrates clustering information according to claim 1, characterized in that, In step S1, the training process of the user attribute encoder and the item attribute encoder, as well as the clustering process of users and items, are as follows: S11. Define the user's age, occupation, and hobbies as the user's attribute information. Define the item's category and production date information as the item's attribute information. ,in and These are vectors representing real user attributes and item attributes using multi-hot encoding, respectively. The user attribute information and item attribute information are input into a user attribute encoder and an item attribute encoder, respectively, which consist of multiple neural network layers. The user attribute information and item attribute information are encoded as user attribute codes and item attribute codes, respectively. The expressions for the user attribute encoder and the item attribute encoder are as follows: , , in and These represent the user attribute encoder and the item attribute encoder, respectively. Both attribute encoders are trainable. and These represent user attribute codes and item attribute codes, respectively, and both have a dimension of 1. ; S12. Input the user attribute code and the item attribute code into the user attribute reconstructor and the item attribute reconstructor, which are composed of multiple neural network layers, respectively, to obtain the reconstructed user attribute information and the reconstructed item attribute information. The expressions of the user attribute reconstructor and the item attribute reconstructor are as follows: , , in and These represent the reconstructed user attribute information and the reconstructed item attribute information, respectively. and These represent the user attribute refactorer and the item attribute refactorer, respectively. Both attribute refactorers are trainable. S13. First, calculate the user attribute reconstruction loss. Loss of item attribute reconstruction The expression is: , , in This represents the modulo operation on the vector, and then the score loss is calculated. The expression is: , , in, This represents the absolute value operation. This represents the set of user ratings for an item's history. Indicates user For items Real ratings Indicates user For items Predicted score; Next, we calculate the total loss. The expression is: in, The weighting coefficients representing the reconstruction loss; Repeat steps S11 through S13, using the total loss. Perform gradient backpropagation to train the attribute encoder and attribute reconstructor until the maximum number of iterations is reached; S14. After the user attribute encoder and item attribute encoder are trained, step S11 is executed once to obtain the user attribute encoding matrix. and item attribute encoding matrix ,in and They are respectively and A two-dimensional matrix, where each row of the matrix represents the attribute code of a user or item. and Represent the number of users and the number of items respectively; then and As input, the KMeans clustering algorithm is used to cluster user attribute codes and item attribute codes respectively. The categories to which user attribute codes and item attribute codes are divided represent the categories to which users and items are divided, respectively. After clustering, a category number is assigned to each user and item based on the categories to which they are divided.
3. The heterogeneous graph recommendation method that integrates clustering information according to claim 1, characterized in that, In step S2, the construction process of the heterogeneous graph structure is as follows: The user ratings for items are constructed into a user-item rating bipartite graph, which is defined as an "interaction subgraph" and described by the following expression: ,in Represents the user nodes in the graph. This represents the item nodes in the graph. This represents the edges in the graph; the similarity between users and between items is calculated using the inner product of user attribute codes and item attribute codes, respectively. Then, user-user and item-item edges are established based on the similarity. Each user is connected to the previous user. Connect each item to the most similar user, and link each item to the previous one. The topological relationships formed by connecting the most similar items are defined as "attribute subgraphs", and their descriptive expressions are as follows: ,in Represents the user nodes in the graph. This represents the item nodes in the graph. This represents the edges connecting users. Represents the edges between items; the "interaction subgraph" and the "attribute subgraph" together form a heterogeneous graph. .
4. The heterogeneous graph recommendation method that integrates clustering information according to claim 1, characterized in that, In step S4, the user's predicted rating for items is predicted using an inner product and weighted summation method. The predicted ratings are then sorted to generate a list of recommended items for the user, including: Based on the initial node features obtained in step S3 and the node features obtained after multiple aggregations, calculate the inner product of each pair of user features and item features, and then perform a weighted summation. The expression is as follows: , , in Indicates the use of the first The predicted score is calculated by combining the user node features obtained after heterogeneous graph aggregation with the item node features. This indicates the final predicted score. This represents the total number of aggregations performed by the heterogeneous graph aggregator. Then, the items are sorted according to the user's predicted rating for each item, and a recommendation list for the user is generated based on the sorting results.