Rich neighborhood social contact recommendation method based on comparative learning

Through the rich neighborhood social recommendation method based on contrast learning, a user-project interaction graph and user social graph are constructed, and graph convolution and comparison learning technology are used to solve the problems of new users, new items and data sparseness in the existing technology. Improves recommended performance and accuracy.

CN119168795APending Publication Date: 2024-12-20HANGZHOU DIANZI UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411319449.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

Existing collaborative filtering methods are difficult to provide effective recommendations when new users or new items are recommended. In the case of large-scale users and items, due to sparse user rating data and inaccurate calculation similarity, the graph neural network directly integrates users in social recommendations. -User social graph and user-Item interaction graph will damage the representation learning.

Method used

Adopt the rich neighborhood social recommendation method based on contrast learning to construct user-project interaction graph and user social graph, use graph convolution to propagate aggregation vectors, and treat users and their structural neighbors in social graphs as positive in contrast learning. , alternative graph fusion operation, perform cross-view comparison learning to integrate heterogeneous social information.

Benefits of technology

Improve recommendation performance, avoid the damage caused by graph fusion to representation learning, enhance the deep mining and vector representation of user social information, and provide more accurate recommendation results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119168795A_ABST
    Figure CN119168795A_ABST
Patent Text Reader

Abstract

The invention discloses a rich neighborhood social contact recommendation method based on comparative learning, which comprises the following steps: acquiring interaction data of a user and an item from a selected data set, and dividing the data set into a training set and a test set; constructing a user-project interaction graph and a user-user social graph; updating the user, the project and the social embedding vector by using lightweight graph convolution; users and structural neighbors of the users are regarded as right facing for comparative learning; performing cross-view comparative learning between the user-item interaction graph and the user-user social graph, and jointly optimizing a loss function to train a model; and performing recommendation prediction on the test set, and evaluating the performance of the model. According to the method, the social information of the user is fused into a recommendation system, in consideration that direct fusion of heterogeneous information may cause damage to representation learning, cross-view contrast learning is used to maximize the consistency of the same vector in different views, and meanwhile, the relationship between the user and a structural neighbor thereof in the social graph is deeply mined, so that the social information is further enriched, and the recommendation efficiency is improved. And the recommendation performance is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of social recommendation data analysis, and relates to a rich-neighborhood social recommendation method based on contrastive learning. Background Art

[0002] Collaborative filtering is an important part of online platforms (such as e-commerce, news portals, etc.) to reduce information overload for users. In order to predict user preferences for different items from historical behaviors, collaborative filtering has become a key example of recommendation based on users' potential common preferences. By using the data left by users when using applications and browsing the Internet (such as clicks, favorites, etc.), we recommend content that users may be interested in, provide users with personalized services, and optimize the user experience.

[0003] Collaborative filtering is a common method in recommendation systems, which is used to predict content or products that users may like based on their historical behaviors and preferences. The basic idea is to use the similarities between users to make recommendations. Collaborative filtering does not rely on the specific content information of the items, but only uses the user's rating or behavior data, so it can adapt to recommendations in different fields and types. However, for new users or new items, collaborative filtering may find it difficult to provide effective recommendations due to the lack of sufficient historical data. At the same time, in the case of large-scale users and items, user rating data is usually sparse, which may lead to inaccurate calculations of similarity.

[0004] With the popularity of online social communities, users can share their opinions with others. Many people are committed to incorporating online social network information into user-item interaction learning to alleviate the data sparsity problem and improve recommendation performance. TrustSVD was developed to apply SVD to social recommendation. SVD is an MF-based model that has been widely used in recommendation systems. TrustSVD exploits social relationships and considers the implicit feedback of social neighbors as auxiliary implicit feedback of users. TrustMF is an MF-based model that decomposes the social trust network and maps users into two low-dimensional latent feature spaces. In this way, it can capture the influence between users. Graph neural networks have also been proven to be effective in social recommendation. In SocialLGN, the representation of each user and item is propagated in the user-item interaction graph through a graph convolutional layer. On this basis, a new graph fusion operation is designed to fuse the two propagated user representations into an integrated representation.

[0005] Although graph neural networks can utilize users’ social information, they will cause certain damage to representation learning when fusion occurs. This is because the information contained in the user-user social graph and the user-item interaction graph is heterogeneous, and direct fusion will affect the recommendation performance. Summary of the invention

[0006] In order to solve the above technical problems existing in the prior art, the present invention proposes a rich neighborhood social recommendation method based on contrastive learning. Based on the interaction between users and items, a user-item interaction graph and a user social graph are constructed, and graph convolution is used to propagate aggregated vectors. During the propagation process, users and their structural neighbors in the social graph are regarded as positive pairs for contrastive learning, and the adjacent relationships between users in the social graph are fully mined. At the same time, when calculating the final vector, the contrastive learning method is used instead of graph fusion to avoid the damage of graph fusion operation to representation learning. The specific technical solution is as follows:

[0007] A rich neighborhood social recommendation method based on contrastive learning includes the following steps:

[0008] Step 1: Divide the existing data set and obtain the interaction data between users and items from it, build a user-item interaction graph and a user-user social graph;

[0009] Step 2: Use lightweight graph convolution to update the user, project and social vectors in the graph. During the graph convolution process, traverse the user nodes and project nodes, aggregate all the first-order neighbor node information of each node, and then concatenate the output vectors of each layer of the network to obtain the final user vector, project vector and social vector;

[0010] Step 3: In the user-user social graph, the user and his structural neighbors are regarded as positive pairs for contrastive learning to mine hidden user social information and minimize the distance between the user's own vector and the output vector corresponding to its even layer;

[0011] Step 4: Perform cross-view comparative learning between the user-item interaction graph and the user-user social graph to integrate the heterogeneous social information in the user-user social graph into the user-item interaction graph to achieve knowledge transfer, and perform joint optimization of parameters based on the graph neural network to complete the recommendation model training;

[0012] Step 5: Input the test set data into the trained model to make recommendation predictions and evaluate the model performance.

[0013] Furthermore, the step 1 specifically includes:

[0014] Step 1.1, divide the data set into training set and test set in proportion;

[0015] Step 1.2: Build the user-item interaction graph G<U,I> , user-user social graph Gs<U,V> , where U, V represent the user set and its social user set respectively, and I represents the item set.

[0016] Furthermore, the step 2 specifically includes:

[0017] Step 2.1: User-item interaction graph G<U,I> Use lightweight graph convolution to transform the user vector e u With project vector i To update, in the graph convolution process, traverse the user nodes and project nodes, and aggregate all the first-order neighbor node information of each node;

[0018] Step 2.2: In the user-user social graph Gs<U,V> , update the vector e using the same method as step 2.1 v ;

[0019] Step 2.3: Concatenate the output vectors of each layer of the user-item interaction graph and the user-user social graph to obtain the final user vector E u Project Vector E i And the user social vector E v .

[0020] Furthermore, the step 3 specifically includes:

[0021] Step 3.1: The graph convolution-based model performs even information propagation on the user-user social graph, aggregates the information of isomorphic neighbors, extracts potential neighbors within the user, and extracts the initial user vector after multiple graph convolution propagations. Its structural neighbors k is an even number;

[0022] Step 3.2: Transform the user's own vector With the even layer output vector Consider them as positive pairs for contrastive learning. Based on the contrastive estimation loss InfoNCE, the consistency between positive pairs is maximized and the distance between vectors is minimized. The contrastive learning loss function is expressed as:

[0023]

[0024] Among them, s(.) is the cosine similarity function and τ is the temperature coefficient.

[0025] Furthermore, the step 4 specifically includes:

[0026] Step 4.1: In E u and E v Cross-view contrast learning is performed between them to minimize the distance between them. The loss function expression of cross-view contrast learning is:

[0027]

[0028] Step 4.2: Calculate the BPR loss function value of the model to maximize the prediction score. The BPR loss function expression is:

[0029]

[0030] Among them, i + represents the items that have interacted with user u in the training set, and i - are the items that have no interaction with user u in the training set; ln(·) and sigmoid(·) represent the logarithmic function and sigmoid function respectively, λ controls L2 regularization, θ represents the training parameter, is the probability that user u interacts with item i, expressed as

[0031] Step 4.3: Jointly optimize the parameters of the graph neural network to complete the training of the recommendation model. The joint optimization loss function expression is:

[0032]

[0033] Among them, α and β are loss functions With L ssl The weight of .

[0034] Furthermore, the step 5 specifically includes:

[0035] Step 5.1: Put the trained model on the test set to perform user recommendation prediction;

[0036] Step 5.2: Use the two evaluation indicators of normalized discounted cumulative gain NDCG and hit rate HR to evaluate the model performance. The expression is:

[0037]

[0038] Where HR is the item that the user cares about, which represents the prediction accuracy; N is the number of users, hits(i) indicates whether the item interacted by the i-th user exists in the recommendation result, which is 1 if it exists and 0 if it does not; NDCG@N is the normalized discounted cumulative gain, r(i) is the relevance score, r(1) indicates that the recommendation result interacts with the user, and r(0) indicates that there is no interaction, and |REL| indicates the first M recommended items sorted in descending order by r(i).

[0039] The present invention considers constructing a user-user social graph to supplement user social information, and uses rich neighborhood contrastive learning to deeply mine social information between users, and replaces the direct graph fusion method with contrastive learning to improve recommendation performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 is a flowchart of a rich neighborhood social recommendation method based on contrastive learning according to an embodiment of the present invention;

[0041] Figure 2 It is a model architecture diagram of the overall prediction and recommendation method of the present invention. DETAILED DESCRIPTION

[0042] In order to make the purpose, technical scheme and technical effect of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.

[0043] like Figure 1 and Figure 2 As shown, a rich neighborhood social recommendation method based on contrastive learning in an embodiment of the present invention includes the following steps:

[0044] Step 1: Obtain the interaction data between users and items from the selected dataset, divide the dataset into training set and test set, and construct the user-item interaction graph G.<U,I> , user-user social graph Gs<U,V> , including:

[0045] Step 1.1. This embodiment uses data from three real-world data sets: Epinions, Ciao, and Yelp. Epinions and Ciao collect user ratings of products, and Yelp collects user ratings and comments on merchants, as shown in Table 1:

[0046] Table 1

[0047] Dataset Ciao Epinions Yelp user 6776 15210 161305 project 101415 233929 114852 Sparsity 99.9614 99.9823 99.9823 Number of interactions 265308 630391 957923

[0048] Then divide the selected data set into training set and test set in a ratio of 4:1;

[0049] Step 1.2: Users, items and their relationships are usually represented by user-item interaction graphs and user-user social graphs. The user-item interaction graph represents the interaction between users and items, such as clicks and views; the social graph represents the social connections between users; construct the user-item interaction graph G<U,I> , user-user social graph Gs<U,V> ; where U, V represent the user set and its social user set respectively, and I represents the item set. i >0 means that there is an interaction between user u and item i, yu i <0 means there is no interaction between the two. v indicates that there is an observable social connection between user u and user v, such as attention. v =0 means there is no social connection between the two.

[0050] Step 2: Use lightweight graph convolution to update the embedding vector. During the graph convolution process, traverse the user nodes and project nodes, aggregate all first-order neighbor node information of each node, that is, the nodes that interact with it, and finally concatenate the output vectors of each layer of the network to obtain the final user vector and project vector. Specifically, it includes:

[0051] Step 2.1: In the user-item interaction graph G<U,I> Use lightweight graph convolution to transform the user vector e u With project vector i To update, in the process of graph convolution, traverse the user nodes and project nodes, and aggregate all the first-order neighbor node information of each node. The expression is:

[0052]

[0053] in, are the vector representations of user u and item i after the k-th layer update, is the neighborhood of items that user u has interacted with, Indicates the number of items interacted by user u; is the neighborhood of users that have interacted with item i, Represents the number of users who have interacted with item i.

[0054] Step 2.2: In the user-user social graph Gs<U,V> , the social vector e is updated using the same calculation method as step 2.1 v , the expression is:

[0055]

[0056] Among them, Su represents the influence between users in the social graph. The higher its value, the stronger the correlation between users, and the easier it is to influence user behavior; Represents the number of other users connected to user u in the trust graph.

[0057] Step 2.3: Convert the user-item interaction graph G<U,I> The output vectors of each layer in are concatenated to obtain the final user vector E u and the project vector E i , the expression is as follows:

[0058]

[0059] Where K represents the number of graph convolution layers in the user-item interaction graph, and a k represents the weight of the kth layer. In this embodiment, a k =1 / k+1, the user social vector E can be obtained by the same method v .

[0060] Step 3: In the user-user social graph, the user and his structural neighbors are regarded as positive pairs for contrastive learning to mine hidden user social information and minimize the distance between the user's own vector and the output vector corresponding to its even-numbered layer. Specifically, the following steps are performed:

[0061] Step 3.1: Considering that the social graph is a bipartite graph, the graph convolution-based model performs even information propagation on the graph, naturally aggregating the information of isomorphic neighbors, making it easier to extract potential neighbors within the user. After multiple graph convolution propagations, the initial user vector is extracted. Output vector of even layers

[0062] Step 3.2: Transform the user's own vector With the even layer output vector Consider them as positive pairs for contrastive learning. Based on the contrastive estimation loss InfoNCE, the consistency between positive pairs is maximized and the distance between vectors is minimized. The contrastive learning loss function is expressed as:

[0063]

[0064] Among them, k represents an even number of layers, 2 or 4, s(.) is the cosine similarity function, and τ is the temperature coefficient.

[0065] Step 4: Perform cross-view contrastive learning between the user-item interaction graph and the user-user social graph. Use contrastive learning to maximize the consistency between the same vectors in different views and merge them to obtain the final embedding vector. That is, use contrastive learning to transfer knowledge, integrate the heterogeneous social information in the user-user social graph into the user-item interaction graph, and perform joint optimization of parameters based on the graph neural network to complete the recommendation model training. Specifically, it includes:

[0066] Step 4.1: In E u and E v Cross-view contrast learning is performed between them to minimize the distance between them. The loss function expression of cross-view contrast learning is:

[0067]

[0068] Step 4.2: Calculate the BPR loss function value of the model to maximize the prediction score. The BPR loss function expression is:

[0069]

[0070] Among them, i + represents the items that have interacted with user u in the training set, and i -are the items that have no interaction with user u in the training set. ln(·) and sigmoid(·) represent the logarithmic function and sigmoid function respectively, λ controls L2 regularization, and θ represents the training parameter. is the probability that user u interacts with item i, expressed as

[0071] Step 4.3: Add the calculated loss functions according to certain weights and jointly optimize the graph neural network parameters. The overall loss function expression of the joint optimization is:

[0072]

[0073] Among them, L represents the overall loss function, α and β are experimental hyperparameters, and are loss functions With L ssl The weight of .

[0074] Step 5: Input the test set data into the trained model for recommendation prediction, and use HR and NDCG as evaluation indicators to evaluate the model performance, including:

[0075] Step 5.1: After completing the model training, use the divided test set data on the model to predict the recommendation results, sort the candidate recommendation items in descending order according to the prediction score, and recommend the top N items.

[0076] Step 5.2: Select two common evaluation criteria for recommendation systems: hit rate HR and normalized discounted cumulative gain NDCG. The final prediction result of the evaluation model is:

[0077]

[0078] Among them, HR is the item that the user cares about, but the model has not successfully predicted and recommended, which represents the prediction accuracy. N is the number of users, hits(i) indicates whether the item interacted by the i-th user exists in the recommendation result, which is 1 if it exists, and 0 if it does not. NDCG@N is the normalized discounted cumulative gain. r(i) is the relevance score, r(1) indicates that the recommendation result interacts with the user, and r(0) indicates that there is no interaction, and |REL| represents the first M recommended items sorted in descending order by r(i).

[0079] Finally, in order to verify the performance of this method, four classic recommendation models were selected to compare with this method. The experimental results are shown in Table 2:

[0080] Table 2

[0081]

[0082] According to the experimental results in Table 2, this method performs better than other methods in three different data sets, and the recommendation results are more accurate. It can be proved that this method successfully integrates user social information into the recommendation, deeply mines the social information between users, and enhances the vector representation with contrastive learning, which improves the recommendation performance.

[0083] The above is only a preferred implementation case of the present invention and does not limit the present invention in any form. Although the implementation process of the present invention is described in detail above, for those familiar with the art, they can still modify the technical solutions recorded in the above examples, or replace some of the technical features therein with equivalents. All modifications, equivalent replacements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A rich neighborhood social recommendation method based on contrastive learning, characterized in that: The following steps are involved: Step 1: Divide the existing data set and obtain the interaction data between users and items from it, build a user-item interaction graph and a user-user social graph; Step 2: Use lightweight graph convolution to update the user, project and social vectors in the graph. During the graph convolution process, traverse the user nodes and project nodes, aggregate all the first-order neighbor node information of each node, and then concatenate the output vectors of each layer of the network to obtain the final user vector, project vector and social vector; Step 3: In the user-user social graph, the user and his structural neighbors are regarded as positive pairs for contrastive learning to mine hidden user social information and minimize the distance between the user's own vector and the output vector corresponding to its even layer; Step 4: Perform cross-view comparative learning between the user-item interaction graph and the user-user social graph to integrate the heterogeneous social information in the user-user social graph into the user-item interaction graph to achieve knowledge transfer, and perform joint optimization of parameters based on the graph neural network to complete the recommendation model training; Step 5: Input the test set data into the trained model to make recommendation predictions and evaluate the model performance.

2. The rich neighborhood social recommendation method based on contrastive learning according to claim 1, characterized in that: The step 1 specifically includes: Step 1.1, divide the data set into training set and test set in proportion; Step 1.2: Build the user-item interaction graph G<U,I> , user-user social graph Gs<U,V> , where U, V represent the user set and its social user set respectively, and I represents the item set.

3. The rich neighborhood social recommendation method based on contrastive learning according to claim 2, characterized in that: The step 2 specifically includes: Step 2.1: User-item interaction graph G<U,I> Use lightweight graph convolution to transform the user vector e u With project vector i To update, in the graph convolution process, traverse the user nodes and project nodes, and aggregate all the first-order neighbor node information of each node; Step 2.2: In the user-user social graph Gs<U,V> , update the vector e using the same method as step 2.1 v ; Step 2.3: Concatenate the output vectors of each layer of the user-item interaction graph and the user-user social graph to obtain the final user vector E u Project Vector E i And the user social vector E v .

4. The rich neighborhood social recommendation method based on contrastive learning according to claim 3, characterized in that: The step 3 specifically includes: Step 3.1: The graph convolution-based model performs even information propagation on the user-user social graph, aggregates the information of isomorphic neighbors, extracts potential neighbors within the user, and extracts the initial user vector after multiple graph convolution propagations. Its structural neighbors k is an even number; Step 3.2: Transform the user's own vector With the even layer output vector Consider them as positive pairs for contrastive learning. Based on the contrastive estimation loss InfoNCE, the consistency between positive pairs is maximized and the distance between vectors is minimized. The contrastive learning loss function is expressed as: Among them, s(.) is the cosine similarity function and τ is the temperature coefficient.

5. The rich neighborhood social recommendation method based on contrastive learning according to claim 4, characterized in that: The step 4 specifically includes: Step 4.1: In E u and E v Cross-view contrast learning is performed between them to minimize the distance between them. The loss function expression of cross-view contrast learning is: Step 4.2: Calculate the BPR loss function value of the model to maximize the prediction score. The BPR loss function expression is: Among them, i + represents the items that have interacted with user u in the training set, and i - are the items that have no interaction with user u in the training set; ln(·) and sigmoid(·) represent the logarithmic function and sigmoid function respectively, λ controls L2 regularization, θ represents the training parameter, is the probability that user u interacts with item i, expressed as Step 4.3: Jointly optimize the parameters of the graph neural network to complete the training of the recommendation model. The joint optimization loss function expression is: Among them, α and β are loss functions With L ssl The weight of .

6. The rich neighborhood social recommendation method based on contrastive learning according to claim 5, characterized in that: The step 5 specifically includes: Step 5.1: Put the trained model on the test set to perform user recommendation prediction; Step 5.2: Use the two evaluation indicators of normalized discounted cumulative gain NDCG and hit rate HR to evaluate the model performance. The expression is: Among them, HR is the item that the user cares about, which represents the prediction accuracy; N is the number of users, hits(i) indicates whether the item interacted by the i-th user exists in the recommendation results, which is 1 if it exists, and 0 if it does not; NDCG@N is the normalized discounted cumulative gain, r(i) is the relevance score, r(1) indicates that the recommendation result has interaction with the user, r(0) indicates no interaction, and |REL| represents the first M recommended items sorted in descending order by r(i).

Citation Information

Cited By

  • Commodity recommendation method oriented to multi-modal data

    CN119831711A