Diversity recommendation method based on comparative learning
By using the method of comparative learning and heterogeneous graph convolutional network in the diversity recommendation algorithm, the user-project heterogeneous graph is dynamically constructed and the popularity perception coefficient is introduced, which solves the problems of overfitting popular projects and insufficient diversity in the existing recommendation algorithm, and achieves better diversity and accuracy recommendation effects.
Patent Information
- Application Number
- CN202510375957.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-27
- Publication Date
- 2025-06-13
AI Technical Summary
Existing diversity recommendation algorithms are prone to overfitting popular projects when processing uneven interactive data, resulting in a lack of diversity in recommended results and long-tail effects and data sparseness problems.
The diversity recommendation method based on contrast learning is adopted to increase the exposure of long-tail projects by constructing user-project heterogeneous graphs and dynamically constructing links; at the same time, a heterogeneous graph convolutional network is designed for feature extraction, and popularity perception coefficients are introduced in contrast learning to coordinate the representation of embedded projects.
It effectively alleviates the negative impact of long-tail effect and data sparsity on diversity recommendation performance, improves the diversity and accuracy of recommendation results, and avoids negative migration problems.
Smart Images

Figure CN120144875A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of recommendation systems, and particularly relates to a diversity recommendation method based on contrastive learning. Background Art
[0002] With the advent of the big data era, the problem of Internet information overload has become increasingly serious, and recommendation systems have become an important tool for providing personalized recommendation services for users. In fact, the core of a recommendation system is to construct high-quality user and item embeddings, and the most common operation among them is to reconstruct user-item interactions (i.e., collaborative filtering). By analyzing the historical interaction data between users and items, collaborative filtering can discover the potential interest preferences of users, so as to recommend items that users may be interested in. With the continuous development of technology, recommendation systems have gradually incorporated advanced methods such as deep learning and graph neural networks to further improve the accuracy of recommendations.
[0003] Although a recommendation list with accuracy can meet the basic retrieval needs of users, it is not necessarily a satisfactory recommendation result. This is mainly because simply pursuing relevance may lead to homogeneous consumption by users and further trigger problems such as filter bubbles and information cocoons. Therefore, more and more research has begun to focus on diversity recommendation, aiming to improve the diversity of recommendation results while maintaining the accuracy of recommendation results. Traditional diversity recommendation research usually improves the diversity of recommendation results through predefined strategies or explicit relevance joint modeling. Recently, many studies have begun to use graph neural networks (GNNs) to achieve diversity recommendation and have made remarkable progress in this field.
[0004] Despite the recent progress in diversity recommendation algorithms, most studies have ignored the uneven distribution of item frequencies in interaction data. Therefore, models trained on these uneven datasets are prone to overfitting to popular items, resulting in most of the recommendation results being top popular items, thereby reducing the diversity of recommendation results. In fact, the above recommendation process also indirectly leads to the problems of sparse available data and item cold start in the diversity recommendation process. However, in a real scenario, when some long-tail items are given sufficient exposure, these long-tail items can also be liked by users (i.e., the long-tail effect).
[0005] To address the long-tail effect problem, the most intuitive idea is to establish more heterogeneous links that include long-tail items. Meanwhile, performing diversity recommendation on the heterogeneous graph is also beneficial because the heterogeneous graph contains a large amount of heterogeneous information, and higher-order heterogeneous links can make different items more accessible, which helps to mine the potential preference information of users, thereby further enhancing the diversity of user embedding representations. In fact, the operation of increasing the exposure of long-tail items can be regarded as one of the data augmentation methods in contrastive learning. Therefore, graph contrastive learning can provide strong technical support for solving the long-tail effect and item cold start. Although increasing the exposure of long-tail items helps to alleviate the item cold start problem, in the original heterogeneous graph, the head items can already be well represented in the originally richly connected context. Introducing an auxiliary graph may introduce noise in the head item embeddings (i.e., the negative transfer problem), thus reducing the accuracy of the recommendation results. Summary of the Invention
[0006] In view of the problems mentioned in the background art, the present invention proposes a diversity recommendation method based on contrastive learning, which can effectively alleviate the negative impacts of the long-tail effect and data sparsity problems on the diversity recommendation performance, and balance diversity and accuracy in the recommendation system.
[0007] Technical Solution: To solve the above technical problems, the technical solution adopted by the present invention is as follows:
[0008] A diversity recommendation method based on contrastive learning, comprising the following steps:
[0009] Step 1: Construct a user-item heterogeneous graph and perform dynamic link construction;
[0010] Step 2: Extract features based on the heterogeneous graph;
[0011] Step 3: Learn the method model and perform contrastive learning multi-task training and recommendation prediction.
[0012] Preferably, in Step 1, based on the existing user-item interaction information and user social relationships, construct a user-item heterogeneous graph UIHG; for the existing heterogeneous graph , define its user-item interaction matrix as , and the user-user social relationship matrix as ;
[0013] Adopt a dynamic link constructor based on item similarity and popularity to generate links to long-tail items; the dynamic link constructor first constructs an item-item adjacency degree matrix , and then constructs an item-item adjacency matrix ;
[0014] Among them, V, E, and H respectively represent the node set, edge set, and label; U represents the user set; I represents the item set.
[0015] Preferably, it includes step 1.1: similarity calculation and screening;
[0016] Item and item The similarity calculation formula between them is as follows:
[0017] ,
[0018] Among them, and respectively represent the embedding representations of item and item ; represents the similarity between item and item ; According to the item-item similarity and the set similarity threshold to perform similarity screening, specifically:
[0019] ,
[0020] Among them, represents the candidate item set of the adjacency matrix of item , represents the co-call matrix of item and ; represents the adjacency degree matrix of item and .
[0021] Preferably, step 1.2: popularity calculation and screening;
[0022] Calculate the popularity of the item, and the specific calculation formula is:
[0023] ,
[0024] Among them, represents the popularity of item ; represents whether user has interacted with item ;
[0025] For item , after calculating the popularity of each item in its candidate item set , sort in ascending order according to the item popularity; At the same time, set the link addition ratio , select The items with the front proportion are used as the final selected set;
[0026] Based on the obtained set, perform final adjustment on as follows: The specific formula is as follows:
[0027] ,
[0028] wherein, represents item j;
[0029] Based on the "co-purchase" or "co-call" relationship in Step 1.1 and Step 1.2, a new user-item heterogeneous graph NUIHG is obtained.
[0030] Preferably, in Step 2, the specific content of feature extraction based on the heterogeneous graph includes:
[0031] Step 2.1: Mapping;
[0032] Map the embeddings of two different types of adjacent objects into a new common semantic space. The mapping method is as follows:
[0033] ,
[0034] wherein, represents the embedding matrix of the upper layer of the nodes of type , represents the relationship mapping matrix of the nodes of type , represents the embedding representation of the nodes of type mapped to the new common space , and respectively represent the user set and the item set; represents the neighbor type of type .
[0035] Preferably, Step 2.2: Object-level aggregation. The specific calculation formula is as follows:
[0036] ,
[0037] ,
[0038] wherein, represents the self-adjacency matrix of type Ψ, represents the symmetric normalized self-adjacency matrix of the nodes of type ; represents the adjacency matrix between the nodes of type Ψ and the nodes of type Γ; Denote the symmetric normalized adjacency matrix of nodes of type Ψ and nodes of type Γ; Denote the embedding matrix obtained by object-level aggregation of nodes;
[0039] Denote that nodes of type are mapped to the new common space of the embedding representation; Denote the embedding matrix of the upper layer of nodes of type ; Denote the relation mapping matrix of nodes of type ; Denote of the degree matrix; Denote the adjacency relationship between node i and node j in Denote the diagonal function.
[0040] Preferably, step 2.3: type-level aggregation;
[0041] Aggregate the embeddings of adjacent objects of different types, and use the average equation method instead of the attention mechanism to calculate the influence of the information of adjacent objects of different types on the target object. The aggregation process is as follows:
[0042] ,
[0043] ,
[0044] where and denote the output embedding matrix obtained by the heterogeneous graph convolutional network, denote the weight values of different types of nodes, denote the aggregation function; denote the weight of node set U with respect to node set U; denote the weight of node set I with respect to node set U; denote the weight of node set I with respect to node set I; denote the weight of node set U with respect to node set I; denote the embedding matrix obtained by object aggregation of user nodes; denote the embedding matrix obtained by aggregating item nodes to user nodes; denote the embedding matrix obtained by object aggregation of item nodes; denote the embedding matrix obtained by aggregating user nodes to item nodes.
[0045] Preferably, in step 3, the specific content of learning the method model, performing contrastive learning multi-task training and recommendation prediction is:
[0046] Step 3.1: Design the objective function for contrastive learning to ensure the consistency of two heterogeneous views;
[0047] Improve the objective function of contrastive learning by adding a popularity-aware coefficient to coordinate different item embeddings in the two views. The improved contrastive loss formula is as follows:
[0048] ,
[0049] ,
[0050] where, represents the similarity between two items; and respectively represent the embedding representations of item on NUIHG and UIHG, represents the negative sample corresponding to item , and represent the embedding representations of the negative sample pair; is a hyperparameter; represents the number of times an item is interacted; represents the hyperparameter used to control the growth rate; represents the popularity factor of item i.
[0051] Preferably, Step 3.2: Calculate the predicted score of the user for the item;
[0052] The predicted score of the user for the item is obtained by the element-wise product between the user and item embeddings. The specific formula is as follows:
[0053] ,
[0054] where, represents the embedding representation of user , represents the embedding representation of item ; represents the element-wise product operation; represents the predicted score between user and item .
[0055] Preferably, Step 3.3: Optimize the model parameters;
[0056] The specific loss function is calculated as follows:
[0057] ,
[0058] where, Indicates the user has evaluated the project , Indicates the user has not evaluated the project , Indicates the regularization parameter; Indicates a parameter vector; Indicates the Bayesian personalized ranking loss;
[0059] The description of the multi-task training objective is as follows:
[0060] ,
[0061] Among them, Indicates the hyperparameter that controls the proportion of the contrast loss; Indicates the contrast learning loss.
[0062] Beneficial effects: Compared with the prior art, the present invention has the following advantages:
[0063] (1) The present invention proposes a diversity recommendation method based on contrast learning and heterogeneous graph convolutional network, aiming to achieve a balance between diversity and accuracy in the recommendation system. This method can not only improve the exposure of long-tail projects, thus alleviating the long-tail effect problem, but also effectively address the data sparsity problem.
[0064] (2) The present invention constructs a dynamic link constructor, which generates links between different projects based on project similarity and popularity, constructs and dynamically adjusts a new user-project heterogeneous graph to alleviate the biased user-project interaction data distribution. At the same time, a new heterogeneous graph convolutional network is designed to more efficiently mine the embedding information of users and projects in the heterogeneous graph. Through a popularity-aware contrast learning strategy, the negative transfer problem is effectively prevented.
[0065] (3) The present invention uses the publicly available Epinions dataset to conduct a series of in-depth experiments and analyses. The experimental results verify the effectiveness and feasibility of the method proposed by the present invention in diversity recommendation, and at the same time can effectively alleviate the impact of the long-tail effect and data sparsity problem on the diversity recommendation performance. Brief Description of the Drawings
[0066] Figure 1 is a flowchart of the diversity recommendation method based on contrast learning of the present invention;
[0067] Figure 2 is a schematic diagram of the feature extraction process of the heterogeneous graph convolutional network of the present invention, where (a) represents the schematic diagram of the feature extraction process of user nodes, and (b) represents the schematic diagram of the feature extraction process of project nodes. Detailed Implementation Manner
[0068] The following further clarifies the present invention in conjunction with specific embodiments. The embodiments are implemented on the premise of the technical solution of the present invention. It should be understood that these embodiments are only used to illustrate the present invention and not to limit the scope of the present invention.
[0069] As Figure 1 shown, the diversity recommendation method based on contrastive learning provided in this embodiment first uses a dynamic link constructor based on item similarity and popularity to generate links to long-tail items to increase the exposure of long-tail items; at the same time, a new user-item heterogeneous graph is constructed to expand the heterogeneous relationships in the original heterogeneous graph, thereby effectively alleviating the problem of skewed user-item interaction data distribution. Secondly, based on the newly constructed user-item heterogeneous graph, a new heterogeneous graph convolutional network is designed to learn the embedding representations of users and items through three modules: mapping, object-level aggregation, and type-level aggregation, for more efficient feature extraction. At the same time, an item popularity coefficient is introduced into the contrastive loss function to maintain the consistency between the new heterogeneous graph and the original heterogeneous graph by maximizing the consistency of popular items between the two heterogeneous graph structures, thereby solving the negative transfer problem caused by the exposure of long-tail items. Finally, score prediction and diversity recommendation are performed based on the embedding representations of users and items. Specifically, it includes the following three major steps: Step 1 - Step 3:
[0070] Step 1: Construct a user-item heterogeneous graph and perform dynamic link construction;
[0071] Based on the existing user-item interaction information and user social relationships, a user-item heterogeneous graph UIHG is constructed. In order to establish more links containing long-tail items, a dynamic link constructor is designed to dynamically establish connections between items and long-tail items, thereby increasing the exposure of long-tail items. For the existing heterogeneous graph , define its user-item interaction matrix , user-user social relationship matrix . The dynamic link constructor first constructs an item-item adjacency matrix , that is, whether two items are indirectly associated (i.e., co-called / consumed) through a certain user.
[0072] Among them, V, E, and H respectively represent the node set, edge set, and label; U represents the user set; I represents the item set.
[0073] Before establishing the item-item co-call matrix , it is necessary to first construct an item-item adjacency degree matrix , and the specific formula is as follows:
[0074]
[0075] Among them, represents the number of times and have been interacted with by the same user at the same time.
[0076] Connecting valid items helps to improve the diversity of recommendation results and alleviate the long-tail effect and head bias problems. However, connecting invalid items will instead have a negative impact on the training of the model. Therefore, after obtaining the item-item adjacency matrix , the dynamic link constructor will establish valid item-item connections based on the similarity and popularity between items.
[0077] Step 1.1: Similarity calculation and screening;
[0078] To connect valid items, similarity should be the primary screening factor, and only similar items are likely to be connected. If there is no connection between two items, their connection may be invalid and even affect the training of the model.
[0079] The method proposed in the present invention uses cosine similarity to measure the similarity between items and sets a similarity threshold . Only when the similarity is greater than or equal to , the edge of this item-item will be selected. For two items and , the similarity calculation formula between them is as follows:
[0080]
[0081] Among them, and represent the embedding representations of items and . represents the similarity between item and . After that, according to the item-item similarity and the set similarity threshold for similarity screening:
[0082]
[0083] Among them, represents the item-item adjacency matrix, that is, whether two items have been interacted with by the same user (1 if interacted). For item , according to the candidate item set of the corresponding item's adjacency matrix can be obtained . represents item and Common call matrix
[0084] Step 1.2: Popularity calculation and screening
[0085] On the one hand, the main purpose of the dynamic link constructor is to construct links from projects to long-tail projects, thereby increasing the exposure of long-tail projects. However, The projects in the set include many popular projects that have been fully learned in the original graph. Adding additional links to them may interfere with the normal training of the model. Therefore, the constructor should prioritize adding long-tail projects. On the other hand, adding too many project-project connections may affect the efficiency and effectiveness of model training. Therefore, the constructor also needs to control the number of added links.
[0086] Next, project popularity calculation will be performed, that is, calculate the number of times each project has been interacted with. The specific project popularity calculation formula is as follows:
[0087]
[0088] Among them, Represents the popularity of project Represents whether user Has interacted with project
[0089] For project , after calculating the popularity of each project in its candidate project set , sort In ascending order according to project popularity. At the same time, set the link addition ratio , select The top Ratio of projects as the final selection set. The specific formula is as follows:
[0090]
[0091]
[0092]
[0093] Among them, Represents the function of sorting in ascending order according to project popularity. Represents Sorted set. Represents The th candidate project in. Represents the current project The number of project connections established. Represents the final candidate item set for item i.
[0094] After obtaining the set according to the above formula, the method performs a final adjustment on as follows:
[0095]
[0096] Steps 1.1 and 1.2 above utilize the "co-purchase" or "co-call" relationship to greatly expand the number of connections to long-tail items and enrich the heterogeneous relationships in the original heterogeneous graph, resulting in a new user-item heterogeneous graph NUIHG.
[0097] Step 2: Feature extraction based on the heterogeneous graph;
[0098] Based on the user-item heterogeneous graphs UIHG and NUIHG, to improve the overall learning efficiency of the heterogeneous graph, the present invention designs a new heterogeneous graph convolutional network to learn heterogeneous information embeddings. As shown in Figure 2 , the embedding learning process mainly includes the following sub-steps:
[0099] Step 2.1: Mapping;
[0100] For two different types of objects, namely users and items, their features are in different semantic spaces. To make the features of these different types of objects comparable, first map the embeddings of these two different types of adjacent objects into a new common semantic space. The mapping method is as follows:
[0101]
[0102] where represents the embedding matrix of the upper layer of nodes of type , where . represents the relationship mapping matrix of nodes of type , where . represents the embedding representation of nodes of type mapped to the new common space , where . and represent the user set and the item set respectively. represents the neighbor type of type , where, , .
[0103] Step 2.2: Object-level aggregation;
[0104] Step 2.1 Map the hidden embedding representations of all adjacent objects to a common semantic space, and then object-level aggregation will be performed. Since the neighbors of an object belong to different types, and the adjacency matrix between two objects of different types may not even be a square matrix, the GCN model cannot be directly applied for aggregation. The formula for the improved object-level aggregation is as follows:
[0105]
[0106]
[0107] where, represents the self-adjacency matrix of type Ψ, such as a social network or a project co-call matrix. represents the symmetric normalized self-adjacency matrix of nodes of type . represents the symmetric normalized adjacency matrix between nodes of type Ψ and nodes of type Γ. represents the embedding matrix obtained by object-level aggregation of nodes.
[0108] represents the embedding representation of nodes of type mapped to the new common space ; represents the embedding matrix of the previous layer of nodes of type ; represents the relationship mapping matrix of nodes of type ; represents the adjacency matrix between nodes of type Ψ and nodes of type Γ; represents 's degree matrix; represents 's adjacency relationship between node i and node j; represents the diagonal function.
[0109] According to the above formula, a set of aggregation embedding matrices of different types of nodes can be obtained, that is, . Specifically, for the user and project sets, this step can obtain two different sets of embedding matrices, that is, and .
[0110] where, represents the embedding matrix obtained after object aggregation of user nodes; represents the embedding matrix obtained by aggregating project nodes to user nodes; represents the embedding matrix obtained after object aggregation of project nodes; represents the embedding matrix obtained by aggregating user nodes to project nodes.
[0111] Step 2.3: Type-level Aggregation;
[0112] To learn the embedding representations of users and items more comprehensively, this step aggregates the embeddings from adjacent objects of different types. Here, to improve the efficiency of type aggregation, the average equation is used instead of the attention mechanism to calculate the influence of the information of adjacent objects of different types on the target object. The aggregation process is as follows:
[0113]
[0114]
[0115] Among them, and represent the output embedding matrices obtained by the heterogeneous graph convolutional network, and it will be used as the input of the next layer of the network. represents the weight values of different types of nodes. According to the experimental settings, both take 1 / 2. represents the aggregation function; represents the weight of node set U for node set U; represents the weight of node set I for node set U; represents the weight of node set I for node set I; represents the weight of node set U for node set I.
[0116] Step 3: Learning Method Model, Conducting Contrastive Learning Multi-task Training and Recommendation Prediction;
[0117] Step 3.1: Designing the Objective Function of Contrastive Learning to Ensure the Consistency of Two Heterogeneous Views;
[0118] To maintain the consistency of two heterogeneous views, the present invention designs the objective function of contrastive learning The calculation formula of is:
[0119]
[0120] Among them, is introduced in Step 1.1 and is used to calculate the similarity between two items. and respectively represent the embedding representations of item on NUIHG and UIHG, that is, the positive sample pair. represents the negative sample corresponding to item , and represent the embedding representations of the negative sample pair. is a hyperparameter that is used to control the magnitude of the similarity.
[0121] However, there is a problem with the above loss formula. In the original graph UIHG, it is well represented in popular items with rich interactions, while the learning of long-tail items is poor. Therefore, if all items in the two views are aligned without discrimination, it may affect the learning of popular items in UIHG and the learning of long-tail items in NUIHG. So, the present invention improves the objective function of contrastive learning by adding a popularity-aware coefficient to coordinate the different item embeddings in the two views. The improved contrastive loss formula is as follows:
[0122]
[0123] Among them, a popularity-aware coefficient is involved, which is used to control the weight of each item in the contrastive loss. If the item in the original bipartite graph has been interacted with by enough users, efforts should be made to coordinate its representation in the two views to prevent negative transfer. Otherwise, in the case of unreliable original embeddings, the popularity-aware coefficient will become smaller to prevent the influence brought by the original view. For item , its specific calculation formula is as follows:
[0124]
[0125] Among them, is introduced in step 1.2 and is used to calculate the number of times the item is interacted with. represents a hyperparameter used to control the growth rate. The popularity factor of item i.
[0126] According to the heterogeneous graph convolutional network, the embedding information of each user and item can be obtained on the constructed NUIHG.
[0127] Step 3.2: Calculate the predicted score of the user for the item;
[0128] Next, the predicted score of the user for the item is obtained by the element-wise product between the user and item embeddings. The specific formula is as follows:
[0129]
[0130] Among them, represents the embedding representation of user , represents the embedding representation of item . represents the element-wise product operation. represents the predicted score between user and item .
[0131] Step 3.3: Optimize the model parameters;
[0132] Meanwhile, the present invention adopts Bayesian Personalized Ranking to optimize the model parameters. The specific loss function is as follows:
[0133]
[0134] where, represents that user evaluates item , that is, a positive sample pair. represents that user has not evaluated item , that is, a negative sample pair. represents the regularization parameter; represents a parameter vector; represents the Bayesian Personalized Ranking loss.
[0135] The description of the multi-task training objective is as follows:
[0136]
[0137] where, represents the hyperparameter that controls the proportion of the contrast loss; represents the contrast learning loss.
[0138] To further verify the effectiveness and practicality of the method proposed by the present invention, the present invention designs a large number of experiments on the real-world Epinions dataset for evaluation, and uses evaluation metrics such as recall rate (Recall@K), hit rate (HR@K), and coverage rate (Coverage@K) to verify the performance of the method. Among them, the recall rate and the hit rate are related to accuracy, and the coverage rate is related to diversity. At the same time, the following several recommendation methods are selected for comparison to show and verify the effectiveness and feasibility of the method.
[0139] DGRec: It is an advanced GNN-based diversity recommendation method. It adopts three modules: a submodular neighbor selection module, a layer attention mechanism module, and a loss reweighting module.
[0140] LightGCN: It is an advanced recommendation system method. It is a GCN-based model, but the transformation matrix, non-linear activation, and self-loop are removed.
[0141] NGCF: It is an advanced recommendation method that uses neural networks and graph-based models to improve recommendation performance.
[0142] SimGCL: It is a contrastive learning model based on random noise data augmentation, which suggests adding noise to each layer of embeddings to generate positive instances for contrastive learning.
[0143] XSimGCL: It is built on the noise-based augmentation method of SimGCL, discarding ineffective graph augmentations and instead using simple and effective noise-based embedding augmentation to generate CL views.
[0144] Table 1 Comparison of experimental performance of different methods
[0145]
[0146] The experimental results are shown in Table 1, where the training set ratios of the Epinions dataset are {40%, 60%, 80%} respectively. The training set ratio represents the ratio of interactions used for training in the user interaction set, aiming to study the performance differences of methods under different data sparsity levels; the remaining ratio of the dataset is used as the validation set and the test set. In addition, the data marked in bold in the table represents the best results under the same training set ratio.
[0147] In terms of the diversity metric, for different ratios of the training set, the method proposed in the present invention has better coverage than the other six comparison methods: DGRec, LightGCN, NGCF, SimGCL, XSimGCL in most cases. The main reason is that the method proposed in the present invention is a recommendation method with diversity as the main goal. The dynamic link constructor proposed in the present invention can construct links from items to long-tail items, increasing the exposure of long-tail items; the heterogeneous graph convolutional network can effectively utilize the heterogeneous information in the heterogeneous graph to learn the embedding representations of users and items, thereby better mining the potential preference information of users; the improved contrastive learning strategy further narrows the consistency of popular items between the new heterogeneous graph and the original heterogeneous graph, avoiding the negative transfer problem. These designs effectively improve the diversity of the recommendation results, fully verifying the effectiveness of the method proposed in the present invention in improving recommendation diversity.
[0148] In terms of the accuracy metric, when the proportion of the training set is small, the recall rates of LightGCN and NGCF are lower than those of the method proposed in the present invention; while when the proportion of the training set is large, their recall rates are better than those of the method proposed in the present invention. This is mainly because LightGCN and NGCF are recommendation methods aiming at accuracy. In the case of sparse datasets, the models they learn perform poorly. In contrast, the method proposed in the present invention constructs and learns the long-tail item links through a dynamic link constructor and a popularity-aware contrastive learning strategy, and utilizes the heterogeneous graph convolutional network to mine the heterogeneous information in the graph, effectively alleviating the data sparsity and cold start problems. Therefore, its accuracy performance in the case of sparse datasets is better than that of LightGCN and NGCF. At the same time, the method proposed in the present invention is generally superior to other methods in terms of the hit rate metric, which indicates that the method proposed in the present invention can effectively learn the preferences of each user, thus achieving good performance in the hit rate. DGRec is a recommendation method with diversity as the main goal. The components it designs, such as the sub-module neighbor selection module and the loss re-weighting strategy, etc., will reduce the accuracy metric to a certain extent while improving the diversity. Therefore, its overall accuracy metric is lower than that of the method proposed in the present invention. As classic graph contrastive learning recommendation methods, SimGCL and XSimGCL alleviate the problem of data sparsity by establishing auxiliary graphs, so their accuracy metrics perform relatively stably under different training set proportions. However, since they ignore the user preference information hidden in the heterogeneous edges such as social relationships in the graph and do not consider the negative transfer problem, the overall performance of the method model is lower than that of the method proposed in the present invention.
[0149] In summary, the experimental results of recall rate, hit rate, and coverage further verify the effectiveness and feasibility of the method proposed in the present invention. As expected, by combining HGCN and contrastive learning, the method proposed in the present invention can not only achieve better diversity recommendations but also maintain high accuracy.
[0150] The above are only the preferred embodiments of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.
Claims
1. A diversity recommendation method based on contrastive learning, characterized by: The following steps are involved: Step 1: Build a user-item heterogeneous graph and perform dynamic link construction; Step 2: Feature extraction based on heterogeneous graph; Step 3: Learning method model, performing comparative learning multi-task training and recommendation prediction.
2. The diversity recommendation method based on contrastive learning according to claim 1, characterized in that: In step 1, based on the existing user-item interaction information and user social relationships, a user-item heterogeneous graph UIHG is constructed; for the existing heterogeneous graph , define its user-item interaction matrix as , the user-user social relationship matrix is ; A dynamic link builder based on project similarity and popularity is used to generate links to long-tail projects. The dynamic link builder first constructs a project-project adjacency matrix. , and then construct the item-item adjacency matrix ; Among them, V, E, and H represent the node set, edge set, and label respectively; U represents the user set; and I represents the item set.
3. The diversity recommendation method based on contrastive learning according to claim 2, characterized in that: It includes steps 1.1: similarity calculation and screening; project and Projects The similarity calculation formula is as follows: , in, and Respectively indicate the project and Projects Embedded representation of ; Display items With Project Similarity between items; Based on the item-item similarity and the set similarity threshold To perform similarity screening, specifically: , in, Display items The set of candidate items of the adjacency matrix, Display items and The common call matrix, Display items and The adjacency matrix of .
4. The diversity recommendation method based on contrastive learning according to claim 3, characterized in that: Step 1.2: Popularity calculation and screening; Calculate the popularity of the project, the specific calculation formula is: , in, Display items popularity; Indicates user Is it related to the project Interacted; For Projects , calculate its candidate item set After the popularity of each item in Sort by project popularity from small to large; at the same time, set the link addition ratio , select Center front The proportion of items is taken as the final selection set; Based on the obtained Collection, yes Make the final adjustment, the specific formula is as follows: , in, represents item j; Based on the "co-purchase" or "co-call" relationship in step 1.1 and step 1.2, a new user-item heterogeneous graph NUIHG is obtained.
5. The diversity recommendation method based on contrastive learning according to claim 1, characterized in that: In step 2, the specific contents of feature extraction based on heterogeneous graphs include: Step 2.1: Mapping; The embeddings of two adjacent objects of different types are mapped into a new common semantic space as follows: , in, Indicates the type The embedding matrix of the previous layer of the node, Indicates the type The node relationship mapping matrix, Indicates the type The nodes are mapped to the new public space The embedding representation of and Represent the user set and item set respectively; Representation Type Neighbor type.
6. The diversity recommendation method based on contrastive learning according to claim 5, characterized in that: Step 2.2: Object-level aggregation. The specific calculation formula is as follows: , , in, represents the self-adjacency matrix of type Ψ, Indicates the type The symmetric normalized self-adjacency matrix of the nodes; Represents the adjacency matrix of nodes of type Ψ and nodes of type Γ; represents the symmetric normalized adjacency matrix of nodes of type Ψ and nodes of type Γ; Represents the embedding matrix of the node after object-level aggregation; Indicates the type The nodes are mapped to the new public space Embedding representation of ; Indicates the type The embedding matrix of the previous layer of the node; Indicates the type The relationship mapping matrix; express The degree matrix of express The adjacency relationship between node i and node j; represents a diagonal function.
7. The diversity recommendation method based on contrastive learning according to claim 6, characterized in that: Step 2.3: Type-level aggregation; Aggregate the embeddings from different types of neighboring objects and use the average equation instead of the attention mechanism to calculate the impact of information from different types of neighboring objects on the target object. The aggregation process is as follows: , , in, and represents the output embedding matrix obtained by the heterogeneous graph convolutional network, Represents the weight values of different types of nodes, Represents an aggregate function; Represents the weight of node set U to node set U; Represents the weight of node set I to node set U; represents the weight of node set I to node set I; Represents the weight of node set U to node set I; Represents the embedding matrix of the user node after object aggregation; Represents the embedding matrix obtained after the project node is aggregated to the user node; Represents the embedding matrix of the project node after object aggregation; Represents the embedding matrix obtained after user nodes are aggregated to item nodes.
8. The diversity recommendation method based on contrastive learning according to claim 1, characterized in that: In step 3, the specific contents of learning method model, contrastive learning multi-task training and recommendation prediction are as follows: Step 3.1: Design the objective function of contrastive learning to ensure the consistency of the two heterogeneous views; The objective function of contrastive learning is improved by adding a popularity-aware coefficient to coordinate the different item embeddings in the two views. The improved contrastive loss formula is as follows: , , in, Indicates the similarity between two items; and Respectively indicate the project Embedding representation on NUIHG and UIHG, Display items The corresponding negative samples are and Represents the embedding representation of negative sample pairs; is a hyperparameter; Indicates the number of times the calculated item is interacted; Indicates that it is used to control Hyperparameters of growth rate; represents the popularity factor of item i.
9. The diversity recommendation method based on contrastive learning according to claim 1, characterized in that: Step 3.2: Calculate the user's predicted rating for the item; The predicted rating of a user for an item is obtained by the element-wise product between the user and item embeddings, as follows: , in, Indicates user The embedding representation of Display items Embedded representation of ; Represents the element-wise product operation; Indicates user and Projects The prediction score between .
10. The diversity recommendation method based on contrastive learning according to claim 1, characterized in that: Step 3.3: Optimize model parameters; The specific loss function is calculated as follows: , in, Indicates user Reviewed the project , Indicates user No projects have been rated , represents the regularization parameter; represents a parameter vector; represents the Bayesian personalized ranking loss; The description of the multi-task training objectives is as follows: , in, Represents the hyperparameter that controls the proportion of contrast loss; represents the contrastive learning loss.
Citation Information
Cited By
Dual contrast learning recommendation method and system, electronic equipment and storage medium
CN120707252A