A recommendation model based on attributes and social relationships

By building a recommendation model based on attributes and social relationships and using embedding layers and attention mechanisms to extract features, the data sparsity and cold start problems are solved, and the accuracy and performance of the recommendation system are improved.

CN115618130BActive Publication Date: 2025-09-12ANHUI NORMAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211305027.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-24
Publication Date
2025-09-12
Estimated Expiration
2042-10-24

AI Technical Summary

Technical Problem

When existing recommendation systems face data sparsity and cold start problems, the performance of collaborative filtering methods is limited, and the influence weights of social relationships cannot be accurately represented, resulting in a decrease in recommendation accuracy.

Method used

By building a recommendation model based on attributes and social relationships, using the embedding layer and attention mechanism, we extract the attributes and social relationship features of users and items, learn accurate social embeddings, and use the attention mechanism to distinguish the importance of different attributes, combined with the prediction layer to perform rating predictions.

Benefits of technology

It effectively alleviates data sparsity and cold start problems, improves the accuracy and performance of the recommendation system, and enhances recommendation results by learning precise social embeddings and attribute importance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115618130B_ABST
    Figure CN115618130B_ABST
Patent Text Reader

Abstract

The present invention discloses a recommendation model based on attributes and social relationships, comprising: an embedding layer I, an embedding layer II, and an embedding layer III; embedding layer I is connected to attention layer I via a text convolution layer and connection layer I, embedding layer II is connected to connection layer III via connection layer II, embedding layer III is directly connected to attention layer III, attention layer III is connected to attention layer II via connection layer III, and attention layer I and attention layer II are connected to a prediction layer via linear layer I and linear layer II, respectively. The recommendation model based on attributes and social relationships constructed by the present invention simultaneously utilizes user and item attributes to construct user and item latent vectors, models the different influences of social friends based on an attention mechanism for social relationships, and learns accurate social embeddings; and considers the user's social relationship as a special attribute of the user, combining it with the user's attribute embedding, designing a novel attention mechanism for attributes to model the influence of different attributes, thereby improving the accuracy of the recommendation system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of personalized recommendation technology, and more specifically, the present invention relates to a recommendation model based on attributes and social relationships. Background Art

[0002] Recommender systems have become ubiquitous tools and play a vital role in e-commerce. Collaborative filtering (CF), a commonly used approach in the recommendation field, learns user preferences by leveraging historical user-item interactions, demonstrating excellent predictive performance and scalability. However, data sparsity has always been a major challenge for CF methods. Cold start is an extreme case of data sparsity, resulting in poor user experience for new users. To address this issue, attribute information (such as user gender and age, item brand and category) can be leveraged to enrich user and item feature representations to mitigate sparsity. When the number of historical user interactions is insufficient, both user and item attributes can provide additional information for modeling user and item features. For example, in movie recommendations, two movies have the same public rating: A is a romance movie, and B is a science fiction movie. Female users are likely to prefer romance movie A, while male users are likely to choose science fiction movie B. This demonstrates that both user and item attributes influence user choices. In addition, different attributes have different importance in characterizing users or items, and users have different preferences for different attributes of items. However, existing research treats different attributes of users (items) equally and cannot distinguish the different importance of different attributes in learning user (item) features.

[0003] Classic collaborative filtering algorithms reveal implicit correlations between user preferences based on observed historical ratings. Social networks can help users quickly find other users with similar preferences, so users' social relationships can also be used to improve the accuracy of recommendation systems. In data-sparse or cold-start environments, users' social relationships can be leveraged to expand their potential representation. However, in real life, different social friends have varying degrees of influence on users' preferences. Existing social relationship-based recommendation models, when aggregating user social relationship features, treat the influence of different friends equally, failing to accurately represent these features. Summary of the Invention

[0004] The present invention provides a recommendation model based on attributes and social relationships, aiming to improve the above problems.

[0005] The present invention is implemented as follows: a recommendation model based on attributes and social relationships, the recommendation model comprising:

[0006] Embedding layer I, embedding layer II and embedding layer III; embedding layer I is connected to attention layer I through text convolution layer and connection layer I, embedding layer II is connected to connection layer III through connection layer II, embedding layer III is directly connected to attention layer III, attention layer III is connected to attention layer II through connection layer III, attention layer I and attention layer II are connected to prediction layer through linear layer I and linear layer II respectively.

[0007] Furthermore, the attribute vector of the project is input into the embedding layer I, which outputs the attribute embedding vector of the project, and then inputs into the text convolution layer to extract semantic features from the attribute embedding vector of the project attribute rich in semantic information. The connection layer I connects the semantic feature vector of the project attribute rich in semantic information with the attribute embedding vector of the project attribute without semantic information, and outputs the comprehensive attribute embedding vector of the project, which is input into the attention layer I, and the attention layer I outputs the deep feature vector of the project.

[0008] The user's attribute vector is input into the embedding layer II, which outputs the user's attribute embedding vector, which is then input into the connection layer II, which outputs the user's comprehensive attribute embedding vector, which is then input into the connection layer III.

[0009] The user's social relationship vector is input into the embedding layer III, which outputs the user's social relationship embedding vector and inputs it into the attention layer III. The attention layer III outputs the social relationship feature vector and inputs it into the connection layer III.

[0010] The connection layer III connects the social relationship feature vector with the user's comprehensive attribute embedding vector, outputs the user's comprehensive attribute-social embedding vector to the attention layer II, and outputs the user's deep feature vector;

[0011] The deep feature vector of the project and the deep feature vector of the user are connected to the prediction layer through the linear layer I and the linear layer II respectively. The prediction layer calculates the user's predicted score for the project and uses the loss function to adjust the parameters of the recommendation model based on the difference between the predicted value and the true value.

[0012] Furthermore, the prediction layer is based on the user's deep feature vector and the item deep feature vector φ j Calculate user u i For project v j Predicted Rating The calculation formula is as follows:

[0013]

[0014] Furthermore, square loss is used as the loss function

[0015] To train the model parameters, they are expressed as follows:

[0016]

[0017] Among them, Γ train represents the training set, r ij Represents user u i For project v j The hyperparameter λ controls the strength of regularization, and Θ represents all trainable parameters in the model.

[0018] Furthermore, the process of obtaining the social relationship feature vector is as follows:

[0019] Set user u i Social embedding vector Perform convolution operation to compress the features of each social relationship, and use sigmoid activation function to reduce noise on the convolution result, and then perform dimensionality reduction through pooling operation to obtain the social relationship feature distribution vector

[0020] The social relationship feature distribution vector Convolution is performed again to generate weights for each social relationship feature, and the output is normalized using the Softmax function. Then, through the pooling operation, the weight vector of the social relationship is obtained.

[0021] Weight vector and social embedding vectors The element product of gets user u i The social relationship feature vector τ i , which is expressed as follows:

[0022]

[0023] Furthermore, the social relationship vector extraction method is as follows:

[0024] The social relationships between users and other users are extracted from the original data set to form the user's social relationship vector. The elements in the social relationship vector indicate whether the user has a friend relationship with other users.

[0025] Furthermore, the text convolution layer is a text convolutional neural network.

[0026] Furthermore, user u i The attribute embedding vector of attribute α And project v j The attribute embedding vector of attribute β The specific meaning is as follows:

[0027]

[0028]

[0029] in, Represent the parameter matrices of embedding layer II and embedding layer I respectively, They represent the number of attribute values ​​of attribute α and attribute β respectively, and d represents the embedding dimension.

[0030] Furthermore, social embedding vector The specific meaning is as follows:

[0031]

[0032] in, represents the parameter matrix of embedding layer III, M represents the number of users, and d represents the embedding dimension.

[0033] The attribute and social relationship-based recommendation model in this invention has the following beneficial effects:

[0034] (1) A novel recommendation method is proposed that integrates the attributes and social relationships of users and items, which can better solve the problems of data sparsity and cold start. (2) An attention mechanism for social relationships is proposed, which can learn the influence weights for different social relationships, learn more accurate social embeddings, and improve recommendation performance. (3) An attention mechanism for attributes is proposed, which can capture the relative importance of different attributes to obtain more accurate user and item representations, alleviating the problems of data sparsity and cold start. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 A schematic diagram of the recommendation model structure based on attributes and social relationships provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0036] The specific implementation methods of the present invention will be further explained in detail below by describing the embodiments with reference to the accompanying drawings, so as to help those skilled in the art to have a more complete, accurate and in-depth understanding of the inventive concept and technical solution of the present invention.

[0037] The recommendation model based on attributes and social relationships constructed by the present invention simultaneously utilizes the attributes of users and items to construct user and item latent vectors, models the different influences of social friends based on the attention mechanism for social relationships, and learns accurate social embeddings; and regards the user's social relationship as a special attribute of the user and combines it with the user's attribute embedding, designs a novel attention mechanism for attributes to model the influence of different attributes, and improves the accuracy of the recommendation system.

[0038] Figure 1 A schematic diagram of the recommendation model structure based on attributes and social relationships provided in an embodiment of the present invention is provided. For ease of explanation, only the parts related to the embodiment of the present invention are shown.

[0039] The recommended model includes:

[0040] Embedding layer I, embedding layer II and embedding layer III;

[0041] Embedding layer I is connected to attention layer I through text convolution layer and connection layer I. Embedding layer II is connected to connection layer III through connection layer II. Embedding layer III is directly connected to attention layer III. Attention layer III is connected to attention layer II through connection layer III. Attention layer I and attention layer II are connected to prediction layer through linear layer I and linear layer II respectively.

[0042] The attribute vector of the project is input into the embedding layer I, which outputs the attribute embedding vector of the project, and then inputs into the text convolution layer to extract semantic features from the attribute embedding vector of the project attribute rich in semantic information. The connection layer I connects the semantic feature vector of the project attribute rich in semantic information with the attribute embedding vector of the project attribute without semantic information, and outputs the comprehensive attribute embedding vector of the project, which is then input into the attention layer I, which outputs the deep feature vector of the project.

[0043] The user's attribute vector is input into the embedding layer II, which outputs the user's attribute embedding vector, which is then input into the connection layer II, which outputs the user's comprehensive attribute embedding vector, which is then input into the connection layer III.

[0044] The user's social relationship vector is input into the embedding layer III, which outputs the user's social relationship embedding vector, which is then input into the attention layer III. The attention layer III outputs the social relationship feature vector, which is then input into the connection layer III.

[0045] The connection layer III connects the social relationship feature vector with the user's comprehensive attribute embedding vector, outputs the user's comprehensive attribute-social embedding vector to the attention layer II, and outputs the user's deep feature vector;

[0046] The deep feature vector of the project and the deep feature vector of the user are connected to the prediction layer through the linear layer I and the linear layer II respectively. The prediction layer calculates the user's predicted score for the project and adjusts the parameters of the recommendation model based on the loss function constructed based on the difference between the predicted value and the true value.

[0047] In the embodiment of the present invention, the process of extracting the user's attribute vector, the project's attribute vector, and the user's social relationship vector is as follows:

[0048] The Movielens-1M dataset is used as the training set and test set of the model, and α is used to represent the user attribute, α∈A u , A u Represents the user attribute set, and uses β to represent the item attribute, β∈A v , A v Represents a set of project attributes. i and Project v j Encode the attribute value of each attribute of user u iThe attribute α is encoded to form the user's attribute vector For project v j The attribute β of the item is encoded to form the attribute vector of the item Extract user u from the original dataset i Social relationships with other users, forming user u i The social relationship vector t i , the elements in the social relationship vector represent user u i Whether you are friends with other users.

[0049] The extraction process of the user's attribute embedding vector, the item's attribute embedding vector, and the user's social relationship embedding vector is as follows:

[0050] Input the attribute vector of the item into the embedding layer I, output the attribute embedding vector of the item, and input the attribute embedding vector of the item into the text convolution layer;

[0051] Input the user's attribute vector into the embedding layer II, output the user's attribute embedding vector, and input the user's attribute embedding vector into the connection layer II;

[0052] Input the user's social relationship vector into the embedding layer III, output the social embedding vector, and input the social embedding vector into the attention layer III;

[0053] The user's attribute vector and the item's attribute vector Input embedding layer II and embedding layer I respectively to obtain user u i The attribute embedding vector of attribute α And project v j The attribute embedding vector of attribute β The specific representation is as follows:

[0054]

[0055]

[0056] in, Represent the parameter matrices of embedding layer II and embedding layer I respectively, They represent the number of attribute values ​​of attribute α and attribute β respectively (for example, the user's gender attribute has two values: male and female), and d represents the embedding dimension, which is a set value.

[0057] Set user u i The social relationship vector t i Input embedding layer III to obtain the social embedding vector e s i, the formula is as follows:

[0058]

[0059] in, represents the parameter matrix of embedding layer III, M represents the number of users, and d represents the embedding dimension, which is a set value.

[0060] The text convolution layer (composed of a text convolutional neural network) inputs the attribute embedding vector of the item attributes rich in semantic information into the text convolution layer to extract semantic features. The semantic feature vectors of the item attributes rich in semantic information and the attribute embedding vectors of the item attributes without semantic information are input into the connection layer I.

[0061] The attributes in the item attribute set include item attributes rich in semantic information and item attributes without semantic information. Semantic features are extracted for item attributes rich in semantic information. The specific extraction process is as follows:

[0062] For project v j Semantically rich attributes Project v j Attributes The attribute embedding vector is Indicates that the attribute embedding vector is extracted through the text convolution layer Semantic feature vector of It is expressed as follows:

[0063]

[0064] Among them, Conv text Represents the text convolution operation, θ represents the parameters of the convolution kernel, Relu is the nonlinear activation function, and Pool represents the pooling operation of the pooling layer.

[0065] The connection layer II connects all the attribute embedding vectors of the user, and the output user comprehensive attribute embedding vector is input into the connection layer III. i User comprehensive attribute embedding vector It is expressed as follows:

[0066]

[0067] in, Represents user u i The attribute embedding vector of the x-th user attribute, L represents the user u i The number of user attributes, assuming that user u i There are three user attributes, and the attribute embedding vector of each user attribute is a 2*4 matrix. Then user u i The user comprehensive attribute embedding vector is a 2*12 matrix.

[0068] The connection layer I connects the semantic feature vector of the project attribute rich in semantic information with the attribute embedding vector of the project attribute without semantic information, outputs the comprehensive attribute embedding vector of the project, inputs the attention layer I, and the project v j The comprehensive attribute embedding vector q j It is expressed as follows:

[0069]

[0070] in, Indicates project v j The attribute embedding vector or semantic feature vector of the y-th item attribute. When the y-th item attribute is rich in semantic information, then is the corresponding semantic feature vector. When the yth item attribute does not contain semantic information, then is the attribute embedding vector; K represents the number of item attributes.

[0071] Attention layer III outputs the social relationship feature vector to connection layer III. The process of obtaining the social relationship feature vector is as follows:

[0072] Set user u i The social embedding vector e s i passes through a convolutional layer Conv s1 , embed the social vector e s Each value in i is compressed into a real number, and the convolution result is denoised using the Sigmoid activation function. It is expressed as follows:

[0073]

[0074] Among them, Conv s1 represents the corresponding convolution operation, θ s1 Represents the parameters of the corresponding convolutional layer, Represents the social embedding vector The social relationship feature distribution vector output after compression, denoising, and pooling.

[0075] Then the social relationship feature distribution vector Through another convolutional layer Conv s2 , explicitly modeling the correlation between different social relationship features by learning parameters, generating weights for each social relationship feature, and normalizing the output using the Softmax function, as shown below:

[0076]

[0077] Similarly, Conv s2 represents the corresponding convolution operation, θ s2 Represents the parameters of the corresponding convolutional layer, is the social embedding vector The weight vector of .

[0078] Based on the weight vector and social embedding vectors Element product of i The social relationship feature vector τ i , which is expressed as follows:

[0079]

[0080] The connection layer III connects the user's social relationship feature vector with the user's comprehensive attribute embedding vector, and the output user's comprehensive attribute-social embedding vector is input into the attention layer II;

[0081] Set user u i The social relationship feature vector τ i Embedding vector with user comprehensive attributes Connect and obtain the user's comprehensive attributes - social embedding vector p i , the formula is as follows:

[0082]

[0083] The user's comprehensive attribute - social embedding vector, and the project's comprehensive attribute embedding vector are respectively obtained through the attention layer II and the attention layer I to obtain the user's deep feature vector and the project's deep feature vector, which are used to represent the importance of different attributes;

[0084] The user's comprehensive attribute - social embedding vector p i And the comprehensive attribute embedding vector q of the project j Each attribute (including social relationships) is processed through a convolutional layer to compress the characteristics of each attribute (including social relationships) into a real number. The attribute feature distribution is then denoised using the Sigmoid activation function. Pooling is then used to reduce the dimension, resulting in an attribute feature distribution vector, which is expressed as follows:

[0085]

[0086]

[0087] Among them, Conv u1 and Conv v1 Represent the corresponding convolution operations, θ u1 ,θ v1 Represents the parameters of the corresponding convolutional layer, Represents user u i and Project v j The attribute feature distribution vector of .

[0088] Then user ui Attribute feature distribution vector Project v j Attribute feature distribution vector Each is processed again through a convolutional layer to explicitly model the correlation between different attribute features by learning parameters, generate weights for each attribute feature, and normalize the output with the Softmax function, as shown below:

[0089]

[0090]

[0091] Among them, Conv u2 and Conv v2 Represent the corresponding convolution operations, θ u2 ,θ v2 Represents the parameters of the corresponding convolutional layer, m i 、n j Represents user u i and Project v j The attribute weight vector of .

[0092] Based on user u i The attribute weight vector m i And the user's comprehensive attributes - social embedding vector p i Calculate user u i The deep feature vector of the project v is connected to the prediction layer through the linear layer II. j The attribute weight vector n j And the comprehensive attribute embedding vector q of the project j Calculate Project v j The deep feature vector of is connected to the prediction layer through the linear layer I and is expressed as follows:

[0093]

[0094]

[0095] in, φ j Represent the user deep feature vector and item deep feature vector respectively; Represent the weight matrix and bias vector of linear layer I, w φ 、b φ denote the weight matrix and bias vector of linear layer II respectively.

[0096] The prediction layer uses the user deep feature vector and the item deep feature vector to predict the user u i For project v jThe neural network model is trained continuously by minimizing the error between the predicted value and the true value to obtain the optimal parameters of the network structure and complete the training of the model.

[0097] In this embodiment of the present invention, the specific process of score prediction and model training is as follows:

[0098] Utilize user deep feature vector and the item deep feature vector φ j Calculate user u i For project v j Predicted Rating The calculation formula is as follows:

[0099]

[0100] Then square loss is used as the loss function To train the model parameters, they are expressed as follows:

[0101]

[0102] Among them, Γ train represents the training set, r ij Represents user u i For project v j The hyperparameter λ controls the strength of regularization to prevent overfitting, and Θ represents all trainable parameters in the model.

[0103] The present invention has been described exemplarily. Obviously, the specific implementation of the present invention is not limited to the above-mentioned method. As long as various non-substantial improvements are made using the method concept and technical solution of the present invention, or the concept and technical solution of the present invention are directly applied to other occasions without improvement, they are all within the scope of protection of the present invention.

Claims

1. A recommendation model based on attributes and social relationships, characterized by: The recommendation model includes: Embedding layer I, embedding layer II and embedding layer III; embedding layer I is connected to attention layer I through text convolution layer and connection layer I, embedding layer II is connected to connection layer III through connection layer II, embedding layer III is directly connected to attention layer III, attention layer III is connected to attention layer II through connection layer III, attention layer I and attention layer II are connected to prediction layer through linear layer I and linear layer II respectively; The attribute vector of the project is input into the embedding layer I, which outputs the attribute embedding vector of the project, and then inputs into the text convolution layer to extract semantic features from the attribute embedding vector of the project attribute rich in semantic information. The connection layer I connects the semantic feature vector of the project attribute rich in semantic information with the attribute embedding vector of the project attribute without semantic information, and outputs the comprehensive attribute embedding vector of the project, which is then input into the attention layer I, which outputs the deep feature vector of the project. The user's attribute vector is input into the embedding layer II, which outputs the user's attribute embedding vector, which is then input into the connection layer II, which outputs the user's comprehensive attribute embedding vector, which is then input into the connection layer III. The user's social relationship vector is input into the embedding layer III, which outputs the user's social relationship embedding vector and inputs it into the attention layer III. The attention layer III outputs the social relationship feature vector and inputs it into the connection layer III. The connection layer III connects the social relationship feature vector with the user's comprehensive attribute embedding vector, outputs the user's comprehensive attribute-social embedding vector to the attention layer II, and outputs the user's deep feature vector; The deep feature vectors of items and users are connected to the prediction layer through linear layer I and linear layer II respectively. The prediction layer calculates the user's predicted rating of the item and adjusts the parameters of the recommendation model based on the loss function constructed based on the difference between the predicted value and the true value. The process of obtaining the social relationship feature vector is as follows: Set user u i Social embedding vector Perform convolution operation to compress the features of each social relationship, and use sigmoid activation function to reduce noise on the convolution result, and then perform dimensionality reduction through pooling operation to obtain the social relationship feature distribution vector The social relationship feature distribution vector Convolution is performed again to generate weights for each social relationship feature, and the output is normalized using the Softmax function. Then, through the pooling operation, the weight vector of the social relationship is obtained. Weight vector and social embedding vectors The element product of gets user u i The social relationship feature vector τ i , which is expressed as follows:

2. The recommendation model based on attributes and social relationships as claimed in claim 1, characterized in that: The prediction layer is based on the user's deep feature vector and the item deep feature vector φ j Calculate user u i For project v j Predicted Rating The calculation formula is as follows:

3. The recommendation model based on attributes and social relationships as claimed in claim 1, characterized in that: Use squared loss as loss function To train the model parameters, they are expressed as follows: Among them, Γ train represents the training set, r ij Represents user u i For project v j The hyperparameter λ controls the strength of regularization, and Θ represents all trainable parameters in the model.

4. The recommendation model based on attributes and social relationships as claimed in claim 1, characterized in that: The specific method for extracting social relationship vectors is as follows: The social relationships between users and other users are extracted from the original data set to form the user's social relationship vector. The elements in the social relationship vector indicate whether the user has a friend relationship with other users.

5. The recommendation model based on attributes and social relationships as claimed in claim 1, characterized in that: The text convolution layer is a text convolutional neural network.

6. The recommendation model based on attributes and social relationships as claimed in claim 1, characterized in that , user u i The attribute embedding vector of attribute α And project v j The attribute embedding vector of attribute β The specific meaning is as follows: in, Represent the parameter matrices of embedding layer II and embedding layer I respectively, They represent the number of attribute values ​​of attribute α and attribute β respectively, and d represents the embedding dimension.

7. The recommendation model based on attributes and social relationships as claimed in claim 1, characterized in that: Social Embedding Vectors The specific meaning is as follows: in, represents the parameter matrix of embedding layer III, M represents the number of users, and d represents the embedding dimension.

Citation Information

Patent Citations

  • Deep recommendation method and system fusing trust-distrust relationship and attention mechanism

    CN111241423A

  • Social recommendation method of heterogeneous graph convolutional network combining social contact and interest information

    CN111428147A