Social recommendation method and system based on graph attention network

CN117972163BActive Publication Date: 2026-09-15Chinese People's Liberation Army Cyberspace Force Information Engineering University
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410188020.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-20
Publication Date
2026-09-15
Estimated Expiration
2044-02-20

AI Technical Summary

Technical Problem

然而,现有社交推荐方法还存在一定的局限性

Benefits of technology

[0065]This invention addresses the shortcomings of existing social recommendation methods in characterizing the differences in user interactions with various items, social relationships, and preferences. It proposes a social recommendation method and system based on graph attention networks to adaptively extract and fuse user and item features from the social rating graph for rating prediction. First, this invention constructs a social rating graph from user-item historical interactions and social relationships, including user-item rating subgraphs and user-user social subgraphs. Then, an embedding layer maps users and items in the social rating graph into dense vector representations. To adaptively capture user behavior features in the rating subgraphs, this invention designs a user behavior modeling method based on graph attention networks for aggregating user-interacting items. To adaptively capture multi-level social features in the social subgraphs, this invention designs a social influence modeling method based on graph attention networks for aggregating users' multi-hop social neighbors. Finally, a rating prediction method based on scaled dot product attention fuses latent features of users and items, user behavior features, and multi-level social features for recommendation. Extensive experiments on three real-world datasets validate the effectiveness and superiority of this invention compared to existing social recommendation methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117972163B_ABST
    Figure CN117972163B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of personalized recommendation, and discloses a social recommendation method and system based on a graph attention network. The method first constructs a social score graph based on user scores for items and user social relationships, then uses a graph attention network to adaptively extract user behavior features and multi-order social features from the social score graph, and finally uses a scaled dot-product attention network to adaptively fuse different features of the user for different items to make recommendations. The application can adaptively extract and fuse features of the user and items in the social score graph to make score predictions, and the effectiveness and superiority of the application are verified through experiments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of personalized recommendation technology, and in particular to a social recommendation method and system based on graph attention networks. Background Technology

[0002] The theoretical basis of social recommendation methods lies in the homogeneity theory in sociology and psychology, which states that users with social connections tend to have similar preferences. In real life, people are more willing to obtain and spread information through social relationships such as relatives, friends, colleagues, and classmates, indicating that social relationships can play a role in item recommendation.

[0003] In social recommendation systems, if a user interacts infrequently, their preferences can be predicted based on the interactions of their friends. Therefore, social recommendation can effectively alleviate the data sparsity problem and improve the rationality and accuracy of recommendations. However, existing social recommendation methods still have certain limitations.

[0004] Problem 1: Existing social recommendation methods fail to adequately characterize the differences in user-interacted items, as different interactive items contribute differently to user preferences. Users tend to interact with highly relevant items, and the interaction rating reflects the user's degree of preference for these items. Therefore, how to model the impact of interactive behavior on user preferences is a problem worthy of further research.

[0005] Question 2: Most existing social recommendation methods only consider the influence of direct social neighbors and fail to adequately characterize the differences in users' social neighbors. As information circulates within social networks, higher-order social relationships also influence users' decisions; furthermore, the strength of a user's relationship with different social neighbors varies, and users are more likely to be influenced by close social neighbors. Therefore, how to model the impact of multi-order social relationships on user preferences is a problem worthy of further research.

[0006] Question 3: Existing methods treat different user characteristics equally in rating prediction, lacking a characterization of the differences in user preferences across various scenarios. In reality, user preferences for different items are influenced to varying degrees by different user characteristics. For example, for some items, users may be more influenced by their social neighbors, while for other items, users may be more inclined to stick to their own opinions. Therefore, how to adaptively integrate user behavioral characteristics and multi-level social characteristics for recommendations on different items is a problem worthy of further research. Summary of the Invention

[0007] To address the aforementioned problems, this invention proposes a social recommendation method and system based on graph attention networks (GASRec). First, a social rating graph is constructed based on user ratings of items and user social relationships. Then, a graph attention network adaptively extracts user behavioral features and multi-level social features from the social rating graph. Finally, a scaled dot-product attention network adaptively fuses different user features for different items to make recommendations. Specifically, to address problem one, a user behavior modeling method based on graph attention networks is designed. This method learns user behavioral features by adaptively aggregating the embedding vectors of each user's interacting items in the rating subgraph. The aggregation weights are adaptively determined based on the relevance between the user and the item and the rating. To address problem two, a social influence modeling method based on graph attention networks is designed. This method learns user multi-level social features by iteratively and adaptively aggregating the current features of each user's social neighbors in the social subgraph. The weights of different social neighbors are adaptively determined based on the strength of the relationship between users. To address problem three, a rating prediction method based on scaled dot-product attention networks is designed. This method predicts user ratings for items by adaptively fusing user behavioral features and multi-level social features for different items.

[0008] To achieve the above objectives, the present invention adopts the following technical solution:

[0009] This invention proposes a social recommendation method based on graph attention networks, comprising:

[0010] Step 1: Construct a social rating graph based on user ratings of items and user social relationships;

[0011] Step 2: Extract features from items and users in the social rating graph; this includes: mapping one-hot encodings of users and items into dense embedding vectors through an embedding layer; using the obtained item embedding vectors as item features; learning user behavioral features by adaptively aggregating the embedding vectors of each user's interactive items based on a graph attention network; learning user social features by adaptively aggregating the behavioral features of each user's followed and fan users; learning multi-level social features of users from social neighbors with different hop counts; and constructing a user feature matrix using user behavioral features and multi-level social features.

[0012] Step 3: Fuse the user's feature matrix, user embedding vector, and item embedding vector to predict the user's rating of the item, and make item recommendations based on the predicted rating.

[0013] Further, step 1 includes:

[0014] Based on user historical rating set Construct a user-item rating subgraph based on the user social relationship matrix. Construct a user-user social subgraph, and bridge the user-item rating subgraph and the user-user social subgraph to form a social rating graph. By incorporating ratings as weights into the user-item connection edges, rating values ​​are also integrated into the social rating graph; whereby... Represents a user set, Represents a set of items, r u,v Indicates user For items In the user social relationship matrix C, the rating is based on the user's social relationship. If a user... Trust another user Then c ij =1, otherwise c ij =0.

[0015] Furthermore, the embedding layer is defined as a linear fully connected layer without bias terms:

[0016]

[0017] in, and Embedding matrices for users and items, respectively; user embedding For the user embedding matrix P, the i-th column is used for item embedding. Let the j-th column of the item embedding matrix Q be d, and let d be the dimension of the node embedding, satisfying the following condition: and Represents user set Total number of users Represents a set of items The total number of items in the game.

[0018] Furthermore, in step 2, the user's behavioral characteristics are learned in the following manner:

[0019]

[0020]

[0021] e u,v =LeakyReLU(a T (W u p u ||W v q v ))

[0022]

[0023] in For the linear mapping matrix of items, Let σ be the bias vector, and σ be the nonlinear activation function. A collection of items that user u has interacted with. Let d′ be the behavioral characteristics of user u, α be the dimension of the output vector, and d′ be the dimension of the output vector. u,v r represents the relevance weight between user u and item v. u,v This represents user u's rating of item v. For the corresponding normalized score, q v Let exp be the embedding vector of item v, and let exp be the exponential function. For the user's linear mapping matrix, Let e ​​be the weight vector, LeakyReLU be the non-linear activation function, || be the vector concatenation operation, and e be the weight vector. u,v For attention weights, p u This represents the embedding vector of user u. The final user behavior feature vector is represented by K, which is the number of heads in the multi-head attention mechanism. For the k-th single-head item aggregation, k = 1, 2, ..., K, the learnable parameters include... and a (k) The output features are represented as d′=d / K, where d is the dimension of node embedding.

[0024] Furthermore, in step 2, the user's social characteristics are learned in the following manner:

[0025] Through positive social aggregation, we aggregate and focus on the characteristics of users:

[0026]

[0027]

[0028]

[0029] in For user u, the set of users they follow. For user u with the kth head of attention and user The strength of the relationship between them For users who follow user u, For user u's social trust characteristics, and These are the learnable parameters of the k-th attention head;

[0030] By leveraging social reverse aggregation, we can aggregate the characteristics of fan users:

[0031]

[0032]

[0033]

[0034] in For user u's fan base For user u with the kth head of attention and user The strength of the relationship between them For user u's fans, For user u's social influence characteristics, and These are the learnable parameters of the k-th attention head.

[0035] Furthermore, in step 2, multiple social aggregation layers are stacked to capture multi-level social features in the user-user social subgraph. Each social aggregation layer takes the user features output by the previous layer as input and outputs updated user features. The updated user features are then used for the next layer of social aggregation. When the given number of aggregation layers L is reached, the social aggregation process stops.

[0036] Furthermore, the method of fusing the user's feature matrix, user embedding vector, and item embedding vector to predict the user's rating of an item includes:

[0037] Fusing user features from different perspectives using multi-head scaling dot product attention:

[0038]

[0039]

[0040]

[0041] in For the output of the k-th head attention, Let u be the feature matrix of user u. For the output matrix, Attention represents the scaling dot product attention operation. Let be the linear mapping matrix of the k-th attention head. A fused feature vector specific to user u and item v;

[0042] f u With p u To perform the splicing and introduce the interaction between user features and user embeddings, a two-layer fully connected network with batch normalization and Dropout is applied to the user splicing features:

[0043] x′ u =Dropout(σ(BatchNorm(W′)) x (f u ||p u )+b′ x )))

[0044] xu =σ(W x x′ u +b x )

[0045] in and This is the weight matrix. and For bias vectors, BatchNorm represents the batch normalization operation, which predicts vectors for users.

[0046] For any item To represent a set of items, a two-layer fully connected network with batch normalization and Dropout is applied to item embedding:

[0047] y′ v =Dropout(σ(BatchNorm(W′)) y q v +b′ y )))

[0048] y v =σ(W y y′ v +b y )

[0049] in This is the weight matrix. For bias vectors, For item prediction vectors;

[0050] After obtaining the user prediction vector and the item prediction vector, the Hadamard product operation is used to introduce the feature interaction between the user and the item:

[0051] z″ u,v =x u ⊙y v

[0052] Where ⊙ represents the Hadamard product between vectors, z″ u,v It is a product vector;

[0053] z″ u,v The input is fed into a two-layer fully connected network with batch normalization and Dropout for further feature interaction:

[0054] z′ u,v =Dropout(σ(BatchNorm(W′)) z z″ u,v +b′ z )))

[0055] z u,v=σ(W z z′ u,v +b z )

[0056] in and This is the weight matrix. and Let D be the bias vector, and D = d / 2. This is the score prediction vector;

[0057] Finally Import / output layer for score prediction:

[0058]

[0059] in The weight vector of the output layer. Predict the rating for user u for item v.

[0060] Another aspect of this invention proposes a social recommendation system based on graph attention networks, comprising:

[0061] The social rating graph construction module is used to build social rating graphs based on users' ratings of items and users' social relationships.

[0062] The social rating graph feature extraction module is used to extract features of items and users in the social rating graph. This includes: mapping one-hot encodings of users and items into dense embedding vectors through an embedding layer; using the obtained item embedding vectors as item features; learning user behavioral features by adaptively aggregating the embedding vectors of each user's interactive items based on a graph attention network; learning user social features by adaptively aggregating the behavioral features of each user's followed and fan users; learning multi-level social features of users from social neighbors with different hop counts; and constructing a user feature matrix using the user's behavioral features and multi-level social features.

[0063] The rating prediction module is used to fuse the user's feature matrix, user embedding vector, and item embedding vector to predict the user's rating for the item, and to recommend items based on the predicted rating.

[0064] Compared with the prior art, the present invention has the following beneficial effects:

[0065] This invention addresses the shortcomings of existing social recommendation methods in characterizing the differences in user interactions with various items, social relationships, and preferences. It proposes a social recommendation method and system based on graph attention networks to adaptively extract and fuse user and item features from the social rating graph for rating prediction. First, this invention constructs a social rating graph from user-item historical interactions and social relationships, including user-item rating subgraphs and user-user social subgraphs. Then, an embedding layer maps users and items in the social rating graph into dense vector representations. To adaptively capture user behavior features in the rating subgraphs, this invention designs a user behavior modeling method based on graph attention networks for aggregating user-interacting items. To adaptively capture multi-level social features in the social subgraphs, this invention designs a social influence modeling method based on graph attention networks for aggregating users' multi-hop social neighbors. Finally, a rating prediction method based on scaled dot product attention fuses latent features of users and items, user behavior features, and multi-level social features for recommendation. Extensive experiments on three real-world datasets validate the effectiveness and superiority of this invention compared to existing social recommendation methods. Attached Figure Description

[0066] Figure 1 This is a general framework diagram of a social recommendation method based on graph attention networks according to an embodiment of the present invention;

[0067] Figure 2 This is a schematic diagram of the network structure of a social recommendation method based on a graph attention network according to an embodiment of the present invention;

[0068] Figure 3 The impact of node embedding dimension on GASRec recommendation performance;

[0069] Figure 4 The impact of the number of social aggregation layers on GASRec recommendation performance;

[0070] Figure 5 This is an ablation experiment of the GASRec feature extraction part in an embodiment of the present invention;

[0071] Figure 6 This is an ablation experiment of the GASRec attention mechanism in an embodiment of the present invention;

[0072] Figure 7 This is a schematic diagram of the architecture of a social recommendation system based on graph attention network according to an embodiment of the present invention. Detailed Implementation

[0073] The present invention will be further explained below with reference to the accompanying drawings and specific embodiments:

[0074] Recommendation based on rating data and social relationships can be formally represented as a rating prediction problem, i.e., completing the missing items in the user-item rating matrix. To define the problem studied in this invention, the relevant notation used is first introduced. The user set involved in rating prediction is represented as follows: Item sets are represented as User ratings of items are represented as a set. Where r u,v Indicates user For items The rating. The adjacency matrix of social relationships between users is represented as... This invention targets directed social networks, where if a user Trust another user Then c ij =1, otherwise c ij =0, therefore the adjacency matrix is ​​asymmetric. Given a set of user historical ratings And the user's social relationship matrix C, this information is first used to construct a social scoring graph. A social rating graph is a special type of heterogeneous graph, containing two types of nodes: users and items, and two types of edges: user-user social relationships and user-item rating relationships. These social relationships and rating relationships each form a user-item rating subgraph and a user-user social subgraph, respectively. If user u... i Trust user u j Then the social rating graph has a directed edge (u i ,u j If user u rates item v as r u,v Then the social rating graph has a line with a weight of r. u,v The edge (u,v).

[0075] The goal of this invention's recommendation task is to comprehensively extract social rating graphs. The system analyzes user behavior and social characteristics, and uses these characteristics to accurately predict missing items in the rating matrix. Finally, the item with the highest predicted rating among items that the user has not interacted with is recommended to that user.

[0076] The overall framework of GASRec, a social recommendation method based on graph attention networks proposed in this invention, is as follows: Figure 1 As shown. This method consists of three main parts, namely, social rating graph construction ( Figure 1 (a) Feature extraction Figure 1 (b) and rating prediction ( Figure 1 (c)). The network structures of the last two parts are as follows: Figure 2 As shown.

[0077] (1) Social rating graph construction: Users' ratings of items and their social relationships are modeled as a heterogeneous graph, such as... Figure 1 As shown in (a). The information that social recommendations can utilize includes a set of users' historical ratings. The user-item rating subgraph and the user-user social relationship matrix C can be represented as a user-item rating subgraph and a user-user social subgraph, respectively. Since both subgraphs contain users, users can bridge them into a social rating graph. Furthermore, by incorporating ratings as weights into the user-item connection edges, rating values ​​are also integrated into the social rating graph. Therefore, the social rating graph can simultaneously describe the influence of a user's historical behavior and social relationships on their preferences.

[0078] (2) Feature Extraction: Extract useful features of users and items from the social rating graph for recommendation, such as... Figure 2 The blue dashed box indicates the main components. It comprises three parts: an embedding layer, user behavior modeling, and social influence modeling. The embedding layer first maps the one-hot encodings of users and items to dense feature representations. Since item features are stable and invariant, the item embedding vectors are directly used as the item's features. Because users belong to both the rating subgraph and the social subgraph, two graph attention network-based aggregations are used to extract user features from these two subgraphs, respectively. Specifically, user behavior modeling is item aggregation in the user-item rating subgraph, which learns a user's behavioral features by adaptively aggregating the embedding vectors of each user's interactive items. Social influence modeling is social aggregation in the user-user social subgraph, including positive and negative social aggregations. These learn a user's social features by adaptively aggregating the behavioral features of each user's following and follower users, respectively. By stacking multiple social aggregation layers, multi-level social features can be learned from social neighbors with different hop counts. Finally, each user's behavioral features and multi-level social features constitute that user's feature matrix.

[0079] (3) Rating Prediction: This involves fusing user feature matrices, user embeddings, and item embeddings to predict user ratings for items, such as... Figure 2 As shown in the red dashed box. Specifically, firstly, an attention network is used to adaptively fuse various features of each user in the two subgraphs into a user-specific item feature vector for different items; then, a multilayer perceptron network is used to fuse each user's embedding vector and the item-specific feature vector into a user prediction vector, and the embedding vector of each item is converted into an item prediction vector; finally, these two prediction vectors are used to predict the user's rating of the item.

[0080] The following sections will elaborate and analyze the two parts: feature extraction and score prediction.

[0081] 1 Feature extraction based on graph attention network

[0082] Feature extraction of social rating graphs mainly includes three parts: embedding layer, user behavior modeling, and social influence modeling. These are used to extract latent features of users and items, user behavior features, and user social features, respectively.

[0083] 1.1 Embedding Layer

[0084] Learning feature representations of users and items in a social rating graph is crucial for social recommendation; therefore, the first step is to vectorize users and items. For the i-th user... and the j-th item Their one-hot encoding representations are respectively and Right now The i-th dimension and The j-th dimension is 1, and the remaining dimensions are 0. Since one-hot encoded representations are typically extremely sparse and high-dimensional, the embedding layer aims to map them into dense and low-dimensional vector representations. The embedding layer can be defined as a linear fully connected layer without bias terms:

[0085]

[0086] in, and Embedding matrices for users and items, respectively; user embedding For the user embedding matrix P, the i-th column is used for item embedding. Let the j-th column of the item embedding matrix Q be d, and let d be the dimension of the node embedding, satisfying the following condition: and Embedding matrices P and Q are learnable parameters of the embedding layer and can be optimized through model training.

[0087] Item features are stable and unaffected by user interactions in the social rating graph. Therefore, the GASRec method of this invention directly utilizes item embeddings as item features for recommendation. However, user preferences are dynamic and easily influenced. Since users participate in both the rating and social subgraphs, their historical behavior and social relationships significantly impact their decisions. To incorporate historical behavior and social influence into user features, GASRec learns user features by propagating user embeddings across the social rating graph. Specifically, GASRec designs two parts: user behavior modeling and social influence modeling, used to extract user behavior features from the user-item rating subgraph and user social features from the user-user social subgraph, respectively.

[0088] 1.2 User Behavior Modeling

[0089] User historical behavior includes the items a user interacts with and their ratings, which together constitute a user-item rating subgraph. Interacting items and corresponding ratings reflect the content and intensity of user preferences, respectively. To characterize user preferences based on historical behavior, GASRec designed a user behavior modeling method based on graph attention networks, capable of simultaneously capturing interaction and rating features in the rating subgraph. Specifically, user behavior modeling involves aggregating items in the rating subgraph, learning user behavior features by adaptively aggregating the embeddings and ratings of each user-interacting item. For any user... User behavior modeling can be formally represented as:

[0090]

[0091] in, For the linear mapping matrix of items, Let σ be the bias vector, and σ be the nonlinear activation function. A collection of items that user u has interacted with. Let d′ be the behavioral characteristics of user u, α be the dimension of the output vector, and d′ be the dimension of the output vector. u,v r represents the relevance weight between user u and item v. u,v This represents user u's rating of item v. For the corresponding normalized score, i.e. In this way, user-item ratings are also incorporated into item aggregation for better user behavior modeling.

[0092] Normalized scoring during item aggregation User-item correlation α u,v Together, they determine the aggregate weight of each interactive item on user behavior characteristics. If α... u,v Set as Item aggregation becomes a graph convolution operation, treating all interactive items for each user equally. However, this aggregation method is flawed because different interactive items contribute differently to user behavior characteristics; users are more likely to interact with highly relevant items. Therefore, attention mechanisms are used to adaptively learn each interactive item. Relevance weights to user u:

[0093] e u,v =LeakyReLU(a T (W u p u ||W v q v (3)

[0094] in, For the user's linear mapping matrix, Let e ​​be the weight vector, LeakyReLU be the non-linear activation function, || be the vector concatenation operation, and e be the weight vector. u,v These are the attention weights. The attention mechanism here is a single-layer feedforward neural network that takes the transformed user and item embeddings as input. Then, by normalizing the above attention weights using the softmax function, we can obtain the relevance weights between user u and item v:

[0095]

[0096] Here, exp is an exponential function used to ensure that the normalized weights are positive. By introducing an attention mechanism, item aggregation becomes a graph attention operation, which can adaptively capture user behavior features in the rating subgraph.

[0097] To further enhance the expressiveness of item aggregation, GASRec employs multi-head attention, simultaneously focusing on information from different subspaces from different locations. Specifically, multi-head item aggregation executes K independent single-head item aggregations with different learnable parameters in parallel (2), where K is the number of heads in the multi-head attention. For the k-th single-head item aggregation, the learnable parameters include... and a (k) The output features are represented as Finally, by concatenating these K output features, we can obtain the final behavioral features of user u:

[0098]

[0099] in, This is the final user behavior feature vector, which can characterize user u's behavior from different perspectives. To keep the feature dimension constant, the dimension d′ is set to d / K. By aggregating items for all users in the rating subgraph, a user behavior feature matrix can be obtained. The i-th column of this matrix represents user u. i behavioral feature vector

[0100] 1.3 Social Influence Modeling

[0101] According to the theory of social homogeneity, due to selection mechanisms and social influence, users with social connections tend to have similar preferences. In social networks, social influence is a natural process by which users acquire and disseminate information through social relationships. During this process, a user's preferences gradually change with the influence of their social neighbors, and different social relationships have different strengths of influence on user preferences. To characterize user preferences based on different social relationships, GASRec designed a social influence modeling method based on graph attention networks, which can adaptively capture social features in social subgraphs. Specifically, social influence modeling is social aggregation in social subgraphs; by iteratively and adaptively aggregating the features of each user's social neighbors, it learns the user's multi-level social features.

[0102] This invention targets directed social networks, specifically social trust networks. For any user in a social trust network... There are two types of social relationships: following users (user u's trusted social neighbors) and followers (user u's trusted social neighbors). The behavior of following users has different impacts on user u's preferences, while the behavior of followers reflects user u's preferences from different perspectives. Therefore, social influence modeling also includes two types of social aggregation: positive social aggregation, aggregating the features of following users; and negative social aggregation, aggregating the features of followers. Similar to user behavior modeling, multi-head graph attention networks are used for social aggregation to distinguish the heterogeneity of social influence from different angles. The positive social aggregation of user u can be formally represented as:

[0103]

[0104]

[0105]

[0106] in, Let K be the set of users that user u follows, and K be the number of heads in a multi-head attention mechanism. For user u with the kth head of attention and user The strength of the relationship, the output of positive social aggregation The social trust characteristics of user u and Let be the learnable parameter of the k-th attention, and d′ = d / K. To simplify the notation, the above positive social aggregation operation is represented as a function:

[0107]

[0108] Where Θ S The set of learnable parameters for positive social aggregation, i.e. Social positive aggregation takes the behavioral characteristics of each user and the users they follow as input and learns the user's social trust characteristics.

[0109] Single-layer social aggregation only involves direct social neighbors and does not fully utilize higher-order social information in the social subgraph. On social platforms, users can seek advice not only from direct social neighbors but also from distant, high-prestige social neighbors. As information circulates within social networks, higher-order social relationships also influence user preferences. To characterize user preferences from multi-order social neighbors, GASRec stacks multiple social aggregation layers to capture multi-order social features in the social subgraph. Each social aggregation layer takes the user features output from the previous layer as input and outputs updated user features, which are then used in the next layer of social aggregation. The social aggregation process stops when a given number of aggregation layers L is reached.

[0110] For any user By taking the output features of the positive social aggregation of the user and the users they follow at the (l-1)th (l≥1)th layer as input, the positive social aggregation at the lth layer can be formally represented as:

[0111]

[0112] in, For user u, the l-th order of social trust characteristics Let L be the set of learnable parameters for the L-th layer of positive social aggregation. Through L-th layer positive social aggregation, we can obtain L social trust features of user u, i.e. They profile user preferences based on the number of social interactions users have with different numbers of hops.

[0113] Similarly, by taking the output features of the (l-1)th (l≥1)th layer of social back-aggregation of user u and its followers as input, the lth layer of social back-aggregation of user u can be formally represented as:

[0114]

[0115] The output of the l-th layer social reverse aggregation The l-th order social influence feature of user u For user u's fan base Let L be the set of learnable parameters for the L-th layer of social back-aggregation. Through L-th layer social back-aggregation, L social influence features of user u can be obtained, i.e. They profile user preferences based on the number of social media followers with different hop counts.

[0116] In summary, to distinguish the heterogeneity of social relationship strength and explore the impact of multi-level social relationships, GASRec designed a multi-layer social aggregation method based on a multi-head graph attention network to adaptively capture multi-level social features in social subgraphs. By performing L-layer social aggregation on all users in the social subgraph, L user social trust feature matrices can be obtained from multi-hop social neighbors. And L user social influence feature matrix Where the l-th characteristic matrix S (l) and T (l) The i-th column represents user u i social feature vector and The user social trust feature matrix and the user social influence feature matrix are collectively referred to as the user social feature matrix.

[0117] 2. Attention Network-Based Rating Prediction

[0118] By extracting features based on graph attention networks, various features of users and items can be obtained, including the item embedding matrix Q, the user embedding matrix P, the user behavior feature matrix H, and the user social feature matrix S. (1) ,S (2) ,…,S (L) With T (1) ,T (2) ,…,T (L) These features comprehensively model the complex interactions between users and items in the social rating graph and characterize user preferences from different perspectives. For different items, by assigning different influence weights to these user features, users exhibit different preferences. For example, for some items, users may be more influenced by their social neighbors, while for other items, users may be more assertive of their own opinions. In other words, these user features have different influence weights on user preferences for different items. To characterize the differences in the influence of different user features on user preferences, GASRec designed a rating prediction method based on attention networks, such as... Figure 2 As shown in the red dashed box, this method utilizes an attention mechanism to adaptively fuse multiple user features for different items, thereby improving user preference modeling.

[0119] In form, for any user Two L+1 distinct features can be extracted from the social rating graph, including behavioral features h. u Social trust characteristics and social influence characteristics These features together constitute a feature matrix:

[0120]

[0121] in The feature matrix is ​​called user u.

[0122] To learn the adaptive weights of each user feature for different items, GASRec designed a user feature fusion network based on scaled dot-product attention. The scaled dot-product attention operation maps a set of key-value pairs to the attention output based on the relevance between the query vector and each key vector, as defined below:

[0123]

[0124] in, For the query matrix, The key matrix, Let n be a value matrix. q n is the number of queries. v d is the number of keys and values. k To query the dimensions of the vector and key vector, d v Given the dimension of the value vector, the dimension of the attention output is n. q ×d v Each row of the query matrix, key matrix, and value matrix represents a query vector, key vector, and value vector, respectively, with a one-to-one correspondence between keys and values. If the dimensions d of the query vector and key vector are... k If the value is too large, their dot product will become excessively large. Therefore, a scaling factor is introduced. It is used to avoid the problem of the softmax function gradient being too small due to the dot product value being too large.

[0125] For any item The query is an item embedded in q. v A transpose linear mapping where the keys and values ​​are the user feature matrix X. u Different linear mappings. To further improve the performance, diversity, and stability of user feature fusion, multi-head scaled dot product attention is used to fuse user features from different perspectives:

[0126]

[0127]

[0128] in, Let d' be the output (row vector) of the k-th head attention, where K is the number of heads in the multi-head attention, and d' = d / K. For the output matrix, Attention represents the scaling dot product attention operation, as shown in Equation (13). These are linear mapping matrices for the k-th attention head, which map user features to different subspaces, making the model more flexible. Attention output. This is a fusion feature vector (column vector) specific to user u and item v. It characterizes user u's personalized preference for item v by adaptively weighting and fusing different user features.

[0129] User's personalized characteristics f u Subsequently, with user-embedded p u The data is concatenated to achieve a comprehensive user representation. To impart non-linearity to the model and introduce the interaction between user features and user embeddings, a two-layer fully connected network with batch normalization and Dropout is applied to the user concatenated features:

[0130] x′ u =Dropout(σ(BatchNorm(W x ′(f u ||p u )+b′ x (16)

[0131] x u =σ(W x x′ u +b x ), (17)

[0132] in, and This is the weight matrix. and This is the bias vector. Output vector. The user prediction vector is used as a user feature for rating prediction. `BatchNorm` represents batch normalization, applied before the activation function σ of the first layer of the network to stabilize and accelerate model training. Simultaneously, `Dropout` is applied to the output of the first layer to prevent overfitting. Dropout randomly discards a certain proportion of neurons during training, but uses all neurons for testing. Through batch normalization and Dropout, the proposed method GASRec achieves better generalization ability.

[0133] Since item features are stable and invariant, there's no need for embedding propagation and message aggregation in the social rating graph to model them, reducing model complexity. On the other hand, because user modeling also involves the embedding of interactive items, optimizing item embeddings is also optimized when optimizing user features. Therefore, item embeddings can effectively characterize item features. Similarly, for any item... A two-layer fully connected network with batch normalization and Dropout is applied to item embedding:

[0134] y′ v =Dropout(σ(BatchNorm(W′)) y q v +b′ y (18)

[0135] y v =σ(W y y′ v +b y ), (19)

[0136] in, This is the weight matrix. This is the bias vector. Output vector. This is called the item prediction vector, and it is used as an item feature for rating prediction.

[0137] After obtaining the predicted vector, the Hadamard product operation is then used to introduce the feature interaction between the user and the item:

[0138] z″ u,v =x u ⊙y v (20)

[0139] Where ⊙ represents the Hadamard product between vectors. The product vector z″ u,v The data is then fed into a two-layer fully connected network with batch normalization and Dropout for further feature interaction.

[0140] z′ u,v =Dropout(σ(BatchNorm(W′)) z z″ u,v +b′ z ))), (twenty one)

[0141] z u,v =σ(W z z′ u,v +b z ), (twenty two)

[0142] in, and This is the weight matrix. and Let D be the bias vector, and D = d / 2. Output vector. This is called the rating prediction vector, and it is finally imported into the output layer for rating prediction.

[0143]

[0144] in, The weight vector of the output layer. Predict the rating for user u for item v.

[0145] 3 Model Training

[0146] The learnable parameters of the GASRec method in this invention are the weight matrices and bias vectors of each network structure, mainly including the embedding layers P and Q, and user behavior modeling. Social Influence Modeling Scaling Dot Product Attention and W o Fully connected layer W′ x b′ x W x b x 、W′ y b′ y W y b y 、W′ z b′ z W z b z and w o To learn the model parameters, this invention utilizes a regression framework to minimize the squared loss between predicted and actual ratings. The objective function for model optimization is the squared loss with a regularization term:

[0147]

[0148] Where Θ is the set of all learnable parameters of the model. For the scoring training set, r u,v Let Ω be the actual rating of user u for item v, λ be the regularizer, and λ be the regularization coefficient.

[0149] To optimize the network model of GASRec, this invention uses mini-batch Adam to minimize the objective function (24) and uses the back propagation algorithm to update the model parameters.

[0150] 4. Experimental Results and Analysis

[0151] This section first introduces the experimental setup, including the dataset, comparison method, evaluation metrics, and parameter settings. Second, extensive experiments are conducted on three real-world datasets to verify the effectiveness and superiority of the proposed recommendation method, GASRec. Then, the impact of hyperparameters on GASRec's recommendation performance is analyzed. Finally, ablation experiments are performed on various important components of GASRec to verify the rationality of the model design.

[0152] 4.1 Experimental Setup

[0153] This section will provide a detailed introduction to the experimental setup, including the dataset, comparison methods, evaluation metrics, and parameter settings.

[0154] 4.1.1 Dataset

[0155] To test the recommendation performance of the proposed method GASRec, this section uses three public datasets, including Epinions, Ciao, and FilmTrust, which are widely used for social rating prediction tasks.

[0156] Epinions and Ciao are two well-known product review social networking sites where users can comment on and rate various items, and browse reviews written by others. If a user finds another user's review valuable, they can add that user to their trust list, thus forming a social trust network. Social relationships in Epinions and Ciao are directed, with rating values ​​being integers from 1 to 5. The Epinions and Ciao datasets used in this section were crawled by Tang et al. in May 2011. The Epinions dataset contains 764,352 ratings and 355,813 social relationships between 18,088 users and 261,649 items, while the Ciao dataset contains 283,320 ratings and 111,781 social relationships between 7,317 users and 104,975 items.

[0157] FilmTrust is a film review social networking site where social relationships are directed. Film ratings are discrete values ​​in the range [0.5, 4] with intervals of 0.5. The FilmTrust dataset used in this experiment was crawled by Guo Guibing et al. in June 2011. It contains 18,662 ratings and 1,853 social relationships between 740 users and 1,957 films.

[0158] Since this invention studies the social recommendation problem, users without social relationships in the dataset were removed. Detailed statistical information for these three datasets is shown in Table 1, which provides the number of relationships, relationship density, number of users, and average user degree for both the rating subgraph and the social subgraph. Number of items and average item quality As can be seen, these three datasets have different rating density and social density, i.e., Epinions < Ciao < FilmTrust. Theoretically, the denser the dataset, the more rating data and social information it contains, the more accurately the rating prediction model can learn users' preferences for items, and the higher the accuracy of the rating prediction.

[0159] Table 1. Statistical information of the dataset

[0160]

[0161] 4.1.2 Comparison Method

[0162] To verify the effectiveness and superiority of the proposed method GASRec, this section compares it with four groups of rating prediction methods: (a) traditional collaborative filtering methods, i.e., PMF; (b) traditional social recommendation methods, i.e., SoReg; (c) deep learning-based collaborative filtering methods, including NeuMF and NGCF; and (d) deep learning-based social recommendation methods, including NARec and GraphRec. These comparison methods are described in detail below:

[0163] PMF is a classic probabilistic matrix factorization method that transforms the matrix factorization problem into a maximum likelihood estimation problem. This section implements this method based on Surprise, a Python library for recommender systems.

[0164] SoReg: This method is a matrix factorization-based social recommendation approach that uses social network information as a regularization term to constrain the objective function of matrix factorization. This section implements this method using QRec, a Python-based recommendation system framework.

[0165] NeuMF: This method is a neural network-based collaborative filtering recommendation approach, which is a fusion of two model instances (Generalized Matrix Factorization (GMF) and Multilayer Perceptron (MLP)) within the NCF framework. This section implements the method based on the code provided by the authors.

[0166] NGCF: This method is a collaborative filtering approach based on graph neural networks. By iteratively propagating user and item embeddings in the user-item graph, it effectively models the higher-order connectivity of the user-item graph and explicitly injects collaborative signals into the embedding process. This section implements the method in PyTorch based on the code provided by the authors.

[0167] NARec: This method is a recommendation approach based on attention networks that fuses auxiliary information. It integrates latent features of users and items, attribute features, and meta-path-based relationship features into an attention-based rating prediction network for recommendation. For the three datasets tested in this section, the selected meta-paths include user-item-user, user-user, and item-user-item.

[0168] GraphRec: This method designs a graph neural network framework that can simultaneously capture interaction and opinion information in the user-item graph, and considers different strengths of social relationships for social recommendation. This section implements the method based on the code provided by the authors.

[0169] Since the original implementations of NeuMF and NGCF are designed for recommendations based on implicit feedback data, their loss functions are binary cross-entropy loss or Bayesian personalized ranking loss. To achieve rating prediction, this section's experiments redefine the output layers of these two methods as linear layers and change their loss functions to squared loss. For a fair performance comparison, the parameters of all comparison methods have been tuned to achieve optimal performance on the three datasets.

[0170] 4.1.3 Evaluation Indicators

[0171] To evaluate the performance of the proposed method GASRec compared to the contrasting methods, this section uses the root mean square error (RMSE) and mean absolute error (MAE) as evaluation metrics, which are widely used in rating prediction tasks. Specifically, RMSE and MAE can be formally expressed as:

[0172]

[0173]

[0174] Where, r u,v This represents the actual rating that user u gave to item v. This represents the predicted score output by the model being tested. (Score set) Divided into training set and test set These two metrics are used for model training and testing, respectively. Clearly, these two evaluation metrics characterize the rating prediction error of the tested model; therefore, the smaller the value, the better the model's recommendation performance.

[0175] 4.1.4 Experimental Environment and Parameter Settings

[0176] As a specific implementation method, the method GASRec of this invention is implemented based on PyTorch and DGL (Deep Graph Library); the experimental software platform is MATLAB R2017a and PyCharm Community Edition based on Python 3.9; the experimental hardware platform is a Lenovo P920 tower graphics workstation with an Intel Xeon Gold 6230R CPU, 128GB of memory, and an NVIDIA GeForce RTX 2080Ti GPU.

[0177] During the model training phase of GASRec, squared loss was chosen as the loss function, L2 regularization was used to prevent overfitting, and a mini-batch Adam with a batch size of 128 was used to optimize the model. To obtain the best rating prediction performance, this section's experiments used a grid search method to find the optimal hyperparameters. Specifically, the optimal learning rate η was searched from the set {0.0002, 0.0005, 0.001, 0.002}, the optimal regularization coefficient λ was searched from the set {0.0002, 0.0005, 0.001, 0.002, 0.005}, the optimal node embedding dimension d was searched from the set {4, 8, 16, 32, 64, 128}, and the optimal number of social aggregation layers L was searched within the interval [1, 5]. In addition, the activation function σ was set to ReLU, the Dropout ratio was set to 0.5, and the number of heads for multi-head attention was set to 4.

[0178] 4.2 Recommended Performance Comparison

[0179] This section presents extensive experiments on three public datasets (Epinions, Ciao, and FilmTrust), comparing the performance of the proposed method GASRec with six benchmark methods (PMF, SoReg, NeuMF, NGCF, NARec, and GraphRec). For each dataset, a known set of ratings is provided. Randomly divided into a training set and a test set To analyze the impact of different rating density on recommendation performance, this section's experiments set three split ratios (training rates) from high to low for the three datasets: 80%, 50%, and 20%. Table 2 shows the rating prediction performance comparison between GASRec and benchmark methods on the three datasets. For ease of comparison, the table shows the performance improvement of GASRec's MAE and RMSE relative to each benchmark method. For each training rate on each dataset, the best result is indicated in bold, and the second-best result is indicated by underline. Analysis of the experimental results leads to the following conclusions:

[0180] Table 2 compares the recommendation performance of GASRec and benchmark methods on three datasets.

[0181]

[0182]

[0183] (1) The traditional social recommendation method SoReg outperforms the traditional collaborative filtering method PMF, indicating that social network information can effectively enrich user preference features, thereby obtaining better recommendations. On the other hand, deep learning-based collaborative filtering methods (NeuMF and NGCF) also outperform PMF, demonstrating the powerful user and item modeling capabilities of neural networks in recommendation systems. Therefore, deep learning-based social recommendation methods (NARec and GraphRec), by combining the advantages of social information and deep learning, achieve the second-best performance on the three datasets.

[0184] (2) The method GASRec of this invention achieves state-of-the-art performance at every training rate on every dataset, and represents a significant improvement over benchmark methods. For example, when the training rate on the Ciao dataset is 20%, GASRec achieves a 28% (31%) improvement over PMF in terms of RMSE (MAE). In particular, GASRec consistently outperforms deep learning-based social recommendation methods (NARec and GraphRec). The main reason for the performance improvement is that GASRec effectively models user behavior and multi-level social relationships, as well as adaptive user feature fusion for different items. These experimental results demonstrate the effectiveness and superiority of GASRec.

[0185] (3) The method GASRec of this invention has achieved excellent performance on datasets with varying densities of ratings and social relationships. The denser the dataset, the more rating data and social information it contains for user and item modeling, resulting in higher accuracy in rating prediction. For example, for the densest dataset FilmTrust, GASRec achieved the best RMSE (0.8040) and MAE (0.6133) with a training rate of 80%; for the sparsest dataset Epinions, GASRec also achieved the best RMSE (1.0771) and MAE (0.8267) with a training rate of 20%. These experimental results demonstrate GASRec's good adaptability to datasets with varying densities.

[0186] (4) For sparser datasets or lower training rates, despite the limited availability of training data, the proposed method GASRec achieves a significant performance improvement over benchmark methods. For example, on the Epinions dataset with a training rate of 80%, GASRec achieves a 12.91% (18.84%) performance improvement over PMF in terms of RMSE (MAE); however, when the training rate decreases to 20%, GASRec's performance improvement over PMF reaches 23.16% (25.14%). On the FilmTrust dataset with a training rate of 80%, GASRec achieves a 9.67% (12.87%) performance improvement over PMF in terms of RMSE (MAE); however, when the training rate decreases to 20%, GASRec's performance improvement over PMF reaches 17.48% (20.26%). These experimental results demonstrate that GASRec effectively alleviates the data sparsity problem and improves recommendation performance.

[0187] 4.3 Hyperparameter Analysis

[0188] This section analyzes the impact of two important hyperparameters on GASRec recommendation performance: the node embedding dimension d and the number of social aggregation layers L. For simplicity, but without loss of generality, we will use a training rate of 0.8 as an example to analyze the hyperparameters.

[0189] 4.3.1 Node Embedding Dimension

[0190] Through the embedding layer, users and items in the social rating graph are transformed into low-dimensional embedding representations. The dimension of the node embedding determines the granularity of feature extraction. To analyze the impact of the node embedding dimension d on recommendation performance, d is set to values ​​from the set {4, 8, 16, 32, 64, 128}. For each node embedding dimension, other hyperparameters are adjusted to achieve optimal performance for GASRec on the three datasets. Experimental results are shown below. Figure 3 As shown.

[0191] The experimental results show that GASRec's prediction accuracy first increases and then decreases with the increase of the node embedding dimension *d*. Specifically, on the sparsest dataset, Epinions, the optimal RMSE is achieved when *d* = 64. However, on the densest dataset, FilmTrust, the optimal RMSE is achieved when *d* = 8. This indicates that sparser datasets require larger node embedding dimensions to represent users and items in the social rating graph. Although the node embedding dimension for the optimal MAE differs from that for the optimal RMSE, they exhibit similar trends across the three datasets. Generally, smaller node embedding dimensions are insufficient to represent the information in a social rating graph, and GASRec benefits from relatively larger node embedding dimensions. However, excessively large node embedding dimensions significantly increase model complexity and lead to overfitting. Therefore, the choice of node embedding dimension represents a trade-off between model performance and efficiency.

[0192] 4.3.2 Number of Social Aggregation Layers

[0193] By stacking multiple social aggregation layers, multi-level social features of users can be obtained from the multi-hop social neighbors of the social rating graph. The number of social aggregation layers determines the scope of social influence. To analyze the impact of the number of social aggregation layers L on recommendation performance, L was set to a value between 1 and 5. For each number of social aggregation layers, other hyperparameters were adjusted to achieve the best performance of GASRec on the three datasets. The experimental results are as follows: Figure 4 As shown.

[0194] The experimental results show that, in most cases, the prediction accuracy of GASRec initially increases and then decreases as the number of social aggregation layers L increases. Specifically, except for the optimal RMSE on the Ciao dataset, which is achieved with a single social aggregation layer, GASRec achieves the best prediction performance when L=2. This result is consistent with other related graph neural network-based recommendation methods, such as DiffNet++ and KGCN. Generally, GASRec benefits from multiple layers of social aggregation because it can effectively model multi-hop social neighbors in the social subgraph. However, stacking too many social aggregation layers can introduce noise and increase model complexity, leading to overfitting and performance degradation.

[0195] 4.4 Ablation Experiment

[0196] This section analyzes the impact of several key components of GASRec on recommendation performance through ablation experiments to verify the rationality of the model design.

[0197] 4.4.1 Feature Extraction Section

[0198] Feature extraction is the most crucial part of the GASRec method in this invention, aiming to extract different features of users and items in the social rating graph for recommendation. Specifically, User Behavior Modeling (UBM) is used to adaptively capture user behavior features in the rating subgraph, while Social Influence Modeling (UIM) is used to adaptively capture multi-level social features of users in the social subgraph. To analyze the impact of different feature extraction modules on recommendation performance, this section compares GASRec with the following two method variants:

[0199] w / o UBM: This method is a variant of GASRec that removes the user behavior modeling part from feature extraction. This variant uses only user behavior features to characterize user preferences, ignoring the user's multi-level social features.

[0200] w / o SIM: This method is a variant of GASRec that removes the social influence modeling part from feature extraction. This variant uses only multi-level social features to characterize user preferences, ignoring user behavioral features.

[0201] A comparison of the recommendation performance of the proposed method GASRec and the two variants mentioned above on three datasets is shown below. Figure 5 As shown in the experimental results, the prediction performance of GASRec on the three datasets decreases to varying degrees after deleting different feature extraction components. These results demonstrate the effectiveness and importance of user behavior modeling and social influence modeling in user feature extraction. By modeling user preferences from multiple perspectives, including latent features, behavioral features, and multi-level social features, GASRec can comprehensively extract user features from the social rating graph for recommendation.

[0202] 4.4.2 Attention Mechanism

[0203] The GASRec method of this invention uses attention mechanisms in three different modules: item attention in user behavior modeling, social attention in social influence modeling, and user feature attention in rating prediction. To analyze the impact of different attention mechanisms on recommendation performance, this section compares GASRec with the following three method variants:

[0204] w / oα: This method is a variant of GASRec that removes item attention from user behavior modeling. Specifically, it removes the relevance weight α in equation (2). u,v Set as This variant treats different items that users interact with equally during the user behavior modeling process.

[0205] w / oβ: This method is a variant of GASRec that removes social attention from social influence modeling. Specifically, it removes social attention from social positive aggregation and social negative aggregation. Set to respectively and This variant treats users’ different social neighbors equally in the process of social influence modeling.

[0206] w / o SDPA: This method is a variant of GASRec that removes Scaled Dot-Product Attention (SDPA) from rating prediction. Specifically, this variant uses average pooling to fuse the different features of each user, i.e., modifying equation (15) to

[0207] A comparison of the recommendation performance of the proposed method GASRec and the three variants mentioned above on three datasets is shown below. Figure 6 As shown in the experimental results, the prediction performance of GASRec on the three datasets decreases to varying degrees after removing different attention mechanisms. These results demonstrate the rationality and necessity of introducing item attention in user behavior modeling, social attention in social influence modeling, and user feature attention in rating prediction. GASRec improves the performance of social recommendation by utilizing attention mechanisms to distinguish the importance of different interactive items in the rating subgraph, the relationship strength of different social neighbors in the social subgraph, and the importance of different user features in user feature fusion.

[0208] Based on the above embodiments, such as Figure 7 As shown, this invention also proposes a social recommendation system based on graph attention networks, comprising:

[0209] The social rating graph construction module is used to build social rating graphs based on users' ratings of items and users' social relationships.

[0210] The social rating graph feature extraction module is used to extract features of items and users in the social rating graph. This includes: mapping one-hot encodings of users and items into dense embedding vectors through an embedding layer; using the obtained item embedding vectors as item features; learning user behavioral features by adaptively aggregating the embedding vectors of each user's interactive items based on a graph attention network; learning user social features by adaptively aggregating the behavioral features of each user's followed and fan users; learning multi-level social features of users from social neighbors with different hop counts; and constructing a user feature matrix using the user's behavioral features and multi-level social features.

[0211] The rating prediction module is used to fuse the user's feature matrix, user embedding vector, and item embedding vector to predict the user's rating for the item, and to recommend items based on the predicted rating.

[0212] In summary, this invention addresses the shortcomings of existing social recommendation methods in characterizing the differences in user interactions with various items, social relationships, and preferences. It proposes a social recommendation method and system based on graph attention networks to adaptively extract and fuse user and item features from the social rating graph for rating prediction. The method first constructs a social rating graph from user-item historical interactions and social relationships, including user-item rating subgraphs and user-user social subgraphs. Then, an embedding layer maps users and items in the social rating graph into dense vector representations. To adaptively capture user behavior features in the rating subgraphs, this invention designs a user behavior modeling method based on graph attention networks for aggregating user-interacting items. To adaptively capture multi-level social features in the social subgraphs, this invention designs a social influence modeling method based on graph attention networks for aggregating users' multi-hop social neighbors. Finally, a rating prediction method based on scaled dot product attention fuses latent features of users and items, user behavior features, and multi-level social features for recommendation. Extensive experiments on three real-world datasets validate the effectiveness and superiority of this invention compared to existing social recommendation methods.

[0213] The above description is only a preferred embodiment of the present invention. It should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A social recommendation method based on graph attention networks, characterized in that, include: Step 1: Construct a social rating graph based on user ratings of items and user social relationships; Step 2: Extract features from items and users in the social rating graph; this includes: mapping one-hot encodings of users and items into dense embedding vectors through an embedding layer; using the obtained item embedding vectors as item features; learning user behavioral features by adaptively aggregating the embedding vectors of each user's interactive items based on a graph attention network; learning user social features by adaptively aggregating the behavioral features of each user's followed and fan users; learning multi-level social features of users from social neighbors with different hop counts; and constructing a user feature matrix using user behavioral features and multi-level social features. Step 3: Fuse the user's feature matrix, user embedding vector, and item embedding vector to predict the user's rating of the item, and make item recommendations based on the predicted rating; In step 2, user behavioral characteristics are learned in the following manner: in For the linear mapping matrix of items, For bias vectors, It is a non-linear activation function. For users A collection of interacted items For users behavioral characteristics The dimension of the output vector. For users and items The correlation weight between them Indicates user For items The rating, For the corresponding normalized score, Let exp be the embedding vector of item v, and let exp be the exponential function. For the user's linear mapping matrix, Let be the weight vector, and LeakyReLU be the non-linear activation function. This is a vector concatenation operation. For attention weights, Indicates user Embedded vector, This is the final user behavior feature vector. It is the number of heads in multi-head attention, for the first... Aggregating single-headed items Learnable parameters include , , and The output features are represented as , = , It is the dimension of node embedding; In step 2, the user's social characteristics are learned in the following manner: Through positive social aggregation, we aggregate and focus on the characteristics of users: in For users The user group that is concerned For the first Users with head attention With users The strength of the relationship between them For users Focus on users For users Social trust characteristics , and It is the first Learnable parameters of head attention; By leveraging social reverse aggregation, we can aggregate the characteristics of fan users: in For users A collection of fans and users For the first Users with head attention With users The strength of the relationship between them For users fans and users For users Social influence characteristics and It is the first Learnable parameters of head attention; The method of fusing user feature matrices, user embedding vectors, and item embedding vectors to predict user ratings for items includes: Fusing user features from different perspectives using multi-head scaling dot product attention: in For the first The output of head attention, For users eigenmatrix For the output matrix, Attention represents the scaling dot product attention operation. For the first The linear mapping matrix of head attention, For users Item-specific fused feature vectors; Will and To perform the splicing and introduce the interaction between user features and user embeddings, a two-layer fully connected network with batch normalization and Dropout is applied to the user splicing features: in and This is the weight matrix. and For bias vectors, BatchNorm represents the batch normalization operation, which predicts vectors for users. For any item , To represent a set of items, a two-layer fully connected network with batch normalization and Dropout is applied to item embedding: in This is the weight matrix. For bias vectors, For item prediction vectors; After obtaining the user prediction vector and the item prediction vector, the Hadamard product operation is used to introduce the feature interaction between the user and the item: in Represents the Hadamard product between vectors. It is a product vector; Will The input is fed into a two-layer fully connected network with batch normalization and Dropout for further feature interaction: in and This is the weight matrix. and Let be the bias vector, and , This is the score prediction vector; Finally Import / output layer for score prediction: in The weight vector of the output layer. For users For items The predicted score.

2. The social recommendation method based on graph attention networks according to claim 1, characterized in that, Step 1 includes: Based on user historical rating set Construct a user-item rating subgraph based on the user social relationship matrix. Construct a user-user social subgraph, and bridge the user-item rating subgraph and the user-user social subgraph to form a social rating graph. By using ratings as weights for user-item connections, rating values ​​are also incorporated into the social rating graph; whereby... Represents a user set, Represents a set of items. Indicates user For items Ratings, user social relationship matrix In the middle, if a user Trust another user ,but ,otherwise .

3. The social recommendation method based on graph attention networks according to claim 1, characterized in that, The embedded layer is defined as a linear fully connected layer without bias terms: in, and Embedding matrices for users and items, respectively; user embedding Embedding matrix for users The Columns, embedded items Embedding the matrix into items The List, It is the dimension of node embedding, satisfying and , Represents user set Total number of users Represents a set of items The total number of items in the text.

4. The social recommendation method based on graph attention networks according to claim 1, characterized in that, In step 2, multiple social aggregation layers are stacked to capture multi-level social features in the user-user social subgraph. Each social aggregation layer takes the user features output by the previous layer as input and outputs updated user features. The updated user features are then used in the next social aggregation layer. When a given number of aggregation layers is reached... After that, the social aggregation process stopped.

5. A social recommendation system based on graph attention networks, characterized in that, include: The social rating graph construction module is used to build social rating graphs based on users' ratings of items and users' social relationships. The social rating graph feature extraction module is used to extract features of items and users in the social rating graph. This includes: mapping one-hot encodings of users and items into dense embedding vectors through an embedding layer; using the obtained item embedding vectors as item features; learning user behavioral features by adaptively aggregating the embedding vectors of each user's interactive items based on a graph attention network; learning user social features by adaptively aggregating the behavioral features of each user's followed and fan users; learning multi-level social features of users from social neighbors with different hop counts; and constructing a user feature matrix using the user's behavioral features and multi-level social features. The rating prediction module is used to fuse the user's feature matrix, user embedding vector, and item embedding vector to predict the user's rating for the item, and to recommend items based on the predicted rating. The social rating graph feature extraction module learns user behavioral characteristics in the following way: in For the linear mapping matrix of items, For bias vectors, It is a non-linear activation function. For users A collection of interacted items For users behavioral characteristics The dimension of the output vector. For users and items The correlation weight between them Indicates user For items The rating, For the corresponding normalized score, Let exp be the embedding vector of item v, and let exp be the exponential function. For the user's linear mapping matrix, Let be the weight vector, and LeakyReLU be the non-linear activation function. This is a vector concatenation operation. For attention weights, Indicates user Embedded vector, This is the final user behavior feature vector. It is the number of heads in multi-head attention, for the first... Aggregating single-headed items Learnable parameters include , , and The output features are represented as , = , It is the dimension of node embedding; The social rating graph feature extraction module learns users' social characteristics in the following way: Through positive social aggregation, we aggregate and focus on the characteristics of users: in For users The user group that is concerned For the first Users with head attention With users The strength of the relationship between them For users Focus on users For users Social trust characteristics , and It is the first Learnable parameters of head attention; By leveraging social reverse aggregation, we can aggregate the characteristics of fan users: in For users A collection of fans and users For the first Users with head attention With users The strength of the relationship between them For users fans and users For users Social influence characteristics and It is the first Learnable parameters of head attention; The method of fusing user feature matrices, user embedding vectors, and item embedding vectors to predict user ratings for items includes: Fusing user features from different perspectives using multi-head scaling dot product attention: in For the first The output of head attention, For users eigenmatrix For the output matrix, Attention represents the scaling dot product attention operation. For the first The linear mapping matrix of head attention, For users Item-specific fused feature vectors; Will and To perform the splicing and introduce the interaction between user features and user embeddings, a two-layer fully connected network with batch normalization and Dropout is applied to the user splicing features: in and This is the weight matrix. and For bias vectors, BatchNorm represents the batch normalization operation, which predicts vectors for users. For any item , To represent a set of items, a two-layer fully connected network with batch normalization and Dropout is applied to item embedding: in This is the weight matrix. For bias vectors, For item prediction vectors; After obtaining the user prediction vector and the item prediction vector, the Hadamard product operation is used to introduce the feature interaction between the user and the item: in Represents the Hadamard product between vectors. It is a product vector; Will The input is fed into a two-layer fully connected network with batch normalization and Dropout for further feature interaction: in and This is the weight matrix. and Let be the bias vector, and , This is the score prediction vector; Finally Import / output layer for score prediction: in The weight vector of the output layer. For users For items The predicted score.

Citation Information

Patent Citations

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

    CN111428147A

  • Recommendation score prediction method and system based on self-center network in online social network

    CN116561444A