A hybrid recommendation method fusing a graph convolutional neural network and a factorization machine
By combining graph convolutional neural networks and factorization machines in a hybrid recommendation method, the long-tail effect and cold-start problem in recommendation systems are solved, achieving efficient recommendation and improved accuracy for long-tail items.
Patent Information
- Application Number
- CN202210829834.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-15
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2042-07-15
AI Technical Summary
Existing recommendation systems struggle to effectively identify long-tail items and lack accuracy when dealing with the long-tail effect and cold start problem, especially when encountering new platforms, new users, and new items.
A hybrid recommendation method combining graph convolutional neural networks and factorization machines is adopted. The graph convolutional neural network mines high-order neighbor information and the factorization machine analyzes the content features of users and items to generate fused recommendation results. The weight matrix is optimized by self-attention calculation and evaluation index.
It improves the accuracy of recommendations for long-tail items, alleviates the cold start problem, and enhances the matching accuracy and data sparsity handling capabilities of the recommendation system.
Smart Images

Figure CN116049534B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of recommendation system, and in particular to a hybrid recommendation method fusing a graph convolutional neural network and a factorization machine BACKGROUND
[0002] With the continuous development of network applications, network resources grow exponentially, and how to efficiently obtain resources that meet the needs has become one of the problems that people are troubled by. The recommendation system can filter and screen information, thereby helping users to retrieve information resources that meet their needs in a personalized way and alleviating the problem of information overload.
[0003] The existing recommendation system has a long tail effect, that is, on a platform with huge total sales, the cumulative total revenue of small sales but many types of products and services that were originally not valued exceeds that of mainstream products. The traditional recommendation algorithm is difficult to mine long tail items, and the graph convolution algorithm can use the user-item interaction graph information to obtain high-order neighbor information in the user-item graph, thereby improving the accuracy of collaborative filtering and realizing the mining of long tail items.
[0004] The cold start problem is also one of the important issues of the recommendation system. In the case of no large amount of data of new platform, new user and new item, the collaborative filtering algorithm is difficult to play a role due to the lack of user-item interaction information, while the content recommendation algorithm can recommend according to the labels of users and items, so it can solve the cold start problem. The factorization machine can analyze the content features of users and items and learn the weights of second-order combination information, thereby enhancing the accuracy of content recommendation and effectively solving the cold start problem. SUMMARY
[0005] In view of the above-mentioned long tail effect problem and cold start problem, the present application provides a hybrid recommendation method fusing a graph convolutional neural network and a factorization machine.
[0006] In order to achieve the above-mentioned purpose, the present application adopts the following technical scheme: a hybrid recommendation method fusing a graph convolutional neural network and a factorization machine, comprising the following steps:
[0007] S1, obtaining user metadata and item metadata as data samples, preprocessing the user metadata and item metadata to obtain user interaction vectors, item interaction vectors, user content vectors and item content vectors, and dividing the preprocessed samples into a training set and a test set;
[0008] S2, calculating the user interaction vectors and the item interaction vectors in the training set by using the graph convolutional neural network, and saving the calculation results of each layer as intermediate results;
[0009] S3, the intermediate result is fused with the initial result by using self-attention calculation to obtain a recommendation result based on a graph convolution network, the initial result being a user interaction vector and an item interaction vector in the training set;
[0010] S4, calculating a user content vector and an item content vector in the training set by using a factorization machine to obtain a recommendation result based on the factorization machine;
[0011] S5, combining the recommendation result based on the graph convolution network and the recommendation result based on the factorization machine to obtain a fused recommendation result, verifying the fused recommendation result by using a test set and an evaluation index, and updating a weight matrix;
[0012] S6, repeating S2-S5 until an iteration termination condition is reached to obtain a final hybrid recommendation result of the fused graph convolution neural network and the factorization machine, the iteration termination condition being that a preset iteration round N (N=100) is reached.
[0013] Further, the preprocessing of S1 includes:
[0014] S11, the user interaction vector and the item interaction vector including a user id and an item id;
[0015] S12, the user content vector including a user id, a user age, a user gender, and a field of interest of the user;
[0016] S13, the item content vector including an id, an item price, an item category, and an item sales volume.
[0017] Further, the graph convolution neural network in S2 includes:
[0018] The user interaction vector and the item interaction vector of the previous layer are subjected to graph convolution calculation to obtain the user interaction vector and the item interaction vector of the current layer, the user interaction vector and the item interaction vector of the current layer are stored, and the process is repeated K (K=3) times, the user interaction vector and the item interaction vector obtained at each layer are saved as an intermediate result, and the graph convolution calculation includes the following formula:
[0019]
[0020] wherein, is a vector representation of an item i at a current layer, is a vector representation of a user u at a current layer, is a vector representation of the item i at a next layer in the graph convolution calculation, is a vector representation of the user u at the next layer in the graph convolution calculation, is a neighbor node set of the user u, is a neighbor node set of the item i.
[0021] Further, the above step S3 comprises:
[0022] S31, randomly generate initial W Q ,W K ,W V Three weight matrices, multiply them with the user interaction vector matrix and the item interaction vector matrix obtained by each layer respectively, get the weighted user weight matrix Q u ,K u ,V u and item weight matrix Q i ,K i ,V i , the formula is as follows:
[0023]
[0024]
[0025] Where, I u is the user interaction matrix, I i is the item interaction matrix, is the vector representation of the user u in the kth layer, is the vector representation of the item i in the kth layer, Q u ,K u ,V u is the user weight matrix, Q i ,K i ,V i is the item weight matrix;
[0026] S32, after transposing multiplication of the weight matrix Q u ,K u ,Q i ,K i , enter the activation function to get the attention score matrix, the formula is as follows:
[0027]
[0028] Where, A u is the user attention score matrix, A i is the item attention score matrix;
[0029] S33, after transposing multiplication of the obtained attention score matrix and V u ,V i , get the final expression of each layer with weight, the formula is as follows:
[0030] e u =∑V u A u , e i =∑Vi A i e u This represents the final weighted representation of each layer;
[0031] S34 performs a summation operation to obtain the final weighted aggregation result, which serves as the recommendation result based on the graph convolutional network. The formula is as follows:
[0032] y LGCN The recommendation results are based on graph convolutional networks;
[0033] Furthermore, the factorization machine algorithm in step S4 above includes:
[0034]
[0035] Where ω is the first-order weight, <V i V j > represents the weights of the second-order feature interactions, x u Let x be the user content vector. i Let y be the content vector of the item. FM The recommended results are from the factorization machine.
[0036] Furthermore, step S5 above includes:
[0037] S51, combining the recommendation results based on graph convolutional networks and the recommendation results based on factorization machines, a fused recommendation result is obtained, as shown in the following formula:
[0038] The recommended results are for fusion;
[0039] S52, use BPR Loss to calculate the number L of items in the recommendation list that the user has interacted with. u ;
[0040] S53, according to L u The evaluation indicators are calculated using the following formula:
[0041]
[0042] Here, Recall@K, or recall rate, measures the number L of items in the recommendation list that the user has interacted with in the Top K (K=20) recommendations. u Number of items that users have interacted with in the test set The proportion, u represents users, and U represents the total number of users;
[0043]
[0044] Wherein NDCG@K is normalized discounted cumulative gain, which measures the relevance score of different positions of the recommendation list, and i represents the i-th result in the list.
[0045] S54, using the Adam optimizer, the evaluation index is updated according to the user weight matrix Q u ,K u ,V u , the item weight matrix Q i ,K i ,V i , the first-order weight omega, and the weight of the second-order feature interaction i ,V j .
[0046] The present application has at least the following beneficial effects:
[0047] The present application uses a graph convolutional neural network to perform a collaborative filtering recommendation task, which can mine high-dimensional information and thus realize recommendation of long-tail items.
[0048] The present application uses a factorization machine to perform a content recommendation task, which can arrange and select features and thus improve the accuracy of recommendation information matching.
[0049] The present application uses a hybrid recommendation of collaborative filtering recommendation and content recommendation, thus breaking the limitations of single-method recommendation and effectively alleviating the cold start problem and the data sparsity problem. BRIEF DESCRIPTION OF DRAWINGS
[0050] Figure 1 is a hybrid recommendation method flowchart of the present application which fuses a graph convolutional neural network and a factorization machine.
[0051] Figure 2 is a graph convolutional neural network architecture diagram provided by an embodiment of the present application.
[0052] Figure 3 is a factorization machine algorithm architecture diagram provided by an embodiment of the present application. DETAILED DESCRIPTION
[0053] The present application will be further described below in combination with the drawings and specific embodiments. It should be pointed out that only an optimized technical solution is used to describe the technical solution and design principle of the present application in detail, but the protection scope of the present application is not limited thereto.
[0054] The above embodiments are preferred embodiments of the present application, but the present application is not limited to the above embodiments. Any obvious improvement, replacement or modification made by those skilled in the art without departing from the essential content of the present application shall fall within the protection scope of the present application.
[0055] As Figure 1 shown, the application provides a hybrid recommendation method combining graph convolutional neural network and factorization machine, comprising the following steps:
[0056] S1, obtaining user metadata and item metadata as data samples, preprocessing the user metadata and item metadata to obtain user interaction vectors, item interaction vectors, user content vectors and item content vectors, and dividing the preprocessed samples into a training set and a test set;
[0057] S2, calculating the user interaction vectors and item interaction vectors in the training set using the graph convolutional neural network, and saving the calculation results of each layer as intermediate results;
[0058] S3, fusing the intermediate results and initial results using self-attention calculation to obtain a recommendation result based on the graph convolutional network, wherein the initial results are the user interaction vectors and item interaction vectors in the training set;
[0059] S4, calculating the user content vectors and item content vectors in the training set using the factorization machine to obtain a recommendation result based on the factorization machine;
[0060] S5, combining the recommendation result based on the graph convolutional network and the recommendation result based on the factorization machine to obtain a fused recommendation result, verifying the fused recommendation result using the test set and evaluation indicators, and updating the weight matrix;
[0061] S6, repeating S2-S5 until the iteration termination condition is reached to obtain the final hybrid recommendation result of the fused graph convolutional neural network and factorization machine, wherein the iteration termination condition is that the preset iteration round N (N=100) is reached.
[0062] As a preferred embodiment of the application, the preprocessing of step S1 comprises:
[0063] S11, the user interaction vectors and item interaction vectors comprise user id and item id;
[0064] S12, the user content vectors comprise user id, user age, user gender and user interested field;
[0065] S13, the item content vectors comprise id, item price, item category and item sales.
[0066] As Figure 2 shown, as a preferred embodiment of the application, the graph convolutional neural network in step S2 comprises:
[0067] The user interaction vector and the item interaction vector of the previous layer are subjected to graph convolution calculation to obtain the user interaction vector and the item interaction vector of the current layer, the user interaction vector and the item interaction vector of the current layer are stored, and the process is repeated K (K=3) times, the user interaction vector and the item interaction vector obtained in each layer are saved as intermediate results, and the graph convolution calculation includes the following formula:
[0068]
[0069] wherein, is the vector representation of the item i in the current layer, is the vector representation of the user u in the current layer, is the vector representation of the item i in the next layer in the graph convolution calculation, is the vector representation of the user u in the next layer in the graph convolution calculation, is the neighbor node set of the user u, is the neighbor node set of the item i.
[0070] As a preferred embodiment of the application, step S3 comprises:
[0071] S31, randomly generating an initial W Q ,W K ,W V Three weight matrices are obtained by multiplying the weight matrices with the user interaction vector matrix and the item interaction vector matrix obtained in each layer, respectively, to obtain the weighted user weight matrix Q u ,K u ,V u and the item weight matrix Q i ,K i ,V i The formula is as follows:
[0072]
[0073] wherein, I u is the user interaction matrix, I i is the item interaction matrix, is the vector representation of the user u in the kth layer, is the vector representation of the item i in the kth layer, Q u ,K u ,V u is the user weight matrix, Q i ,K i ,V i is the item weight matrix;
[0074] S32, the weight matrix Q u ,K u ,Q i ,K iAfter transposition multiplication, the activation function is entered to obtain the attention score matrix, and the formula is as follows:
[0075]
[0076] Wherein, A u is the user attention score matrix, A i is the item attention score matrix;
[0077] S33, the obtained attention score matrix is multiplied by V u ,V i , and the final expression of each layer with weight is obtained, and the formula is as follows:
[0078] e u =∑V u A u , e i =∑V i A i , e u is the final expression of each layer with weight;
[0079] S34, the sum operation is performed to obtain the final weighted aggregation result as the recommendation result based on the graph convolution network, and the formula is as follows:
[0080] y LGCN is the recommendation result based on the graph convolution network;
[0081] As shown in Figure 3 , as a preferred embodiment of the present application, the factorization machine algorithm in step S4 includes:
[0082]
[0083] Wherein, ω is the first-order weight, <V i ,V j > is the weight of the second-order feature interaction, x u is the user content vector, x i is the item content vector, and y FM is the recommendation result of the factorization machine.
[0084] As a preferred embodiment of the present application, step S5 includes:
[0085] S51, the recommendation result based on the graph convolution network and the recommendation result based on the factorization machine are combined to obtain the fused recommendation result, and the formula is as follows:
[0086] is the fused recommendation result;
[0087] S52, calculate the number of items in the recommendation list that the user has interacted with L using BPR Loss u The BPR Loss formula is as follows:
[0088]
[0089] Where M represents the number of users, u represents a user, i and j represent items, H u represents the first-order neighbor set of user u, represents the predicted score of item i by user u, represents the predicted score of item j by user u.
[0090] S53, according to L u Calculate the evaluation index, the formula is as follows:
[0091]
[0092] Where Recall@K, the recall rate, measures the number of items in the recommendation list that the user has interacted with L u in the Top K(K=20) recommendation set proportion of all items that the user has interacted with in the test set, u represents a user, and U represents the total number of users.
[0093]
[0094] Where NDCG@K, the normalized discounted cumulative gain, measures the relevance score of different positions in the recommendation list, and i represents the ith result in the list.
[0095] S54, using the Adam optimizer, update the user weight matrix Q u ,K u ,V u , item weight matrix Q i ,K i ,V i , first-order weight ω, and weight of second-order feature interaction <V i ,V j > according to the evaluation index obtained.
[0096] The process of the Adam optimizer algorithm mainly includes the following three steps:
[0097] 1) Initial model parameters θ;
[0098] 2) Use the specified optimization program update step to obtain new weights
[0099] 3) Update model weights: where a is a learning rate set artificially.
Claims
1. A hybrid recommendation method fusing a graph convolutional neural network and a factorization machine, characterized in that, The method comprises the following steps: S1, obtaining user metadata and item metadata as data samples, preprocessing the user metadata and the item metadata to obtain user interaction vectors, item interaction vectors, user content vectors and item content vectors, and dividing the preprocessed samples into a training set and a test set; S2, calculating the user interaction vectors and the item interaction vectors in the training set by using a graph convolutional neural network, and saving the calculation results of each layer as intermediate results; The graph convolutional neural network in S2 comprises: The user interaction vectors and the item interaction vectors of the previous layer are calculated by graph convolution to obtain the user interaction vectors and the item interaction vectors of the current layer, and the process is repeated K times, K=3, and the user interaction vectors and the item interaction vectors obtained in each layer are saved as intermediate results; The graph convolution calculation comprises the following formula: wherein, is a vector representation of the current layer for item i, is a vector representation of the current layer for user u, is a vector representation of the next layer in the graph convolution computation for item i, is a vector representation of the next layer in the graph convolution computation for user u, is a set of neighbor nodes for user u, is a set of neighbor nodes for item i; S3, fusing the intermediate results and initial results by using self-attention calculation to obtain a recommendation result based on a graph convolutional network, wherein the initial results are the user interaction vectors and the item interaction vectors in the training set; S4, calculating the user content vectors and the item content vectors in the training set by using a factorization machine to obtain a recommendation result based on the factorization machine; The factorization machine algorithm in S4 comprises: where ω is a first-order weight, <V i , j > is a weight of a second-order feature interaction, x u is a user content vector, x i is an item content vector, y FM is a recommendation result of a factorization machine; S5, combining the recommendation result based on the graph convolutional network and the recommendation result based on the factorization machine to obtain a fused recommendation result, verifying the fused recommendation result by using the test set and an evaluation index, and updating a weight matrix; S6, repeating S2-S5 until an iteration termination condition is reached to obtain a final hybrid recommendation result of the fused graph convolutional neural network and the factorization machine, wherein the iteration termination condition is that a preset iteration round N, N=100, is reached. 2.The hybrid recommendation method of fusing graph convolutional neural network and factorization machine according to claim 1, characterized in that, The preprocessing in S1 comprises: S11, the user interaction vectors and the item interaction vectors comprise user ids and item ids; S12, the user content vectors comprise user ids, user ages, user genders and fields of interest of users; S13, the item content vectors comprise ids, item prices, item categories and item sales. 3.The hybrid recommendation method of fusing graph convolutional neural network and factorization machine according to claim 1, characterized in that, S3 comprises: S31, randomly generate initial W Q ,W K ,W V Three weight matrices, multiply them with the intermediate results obtained by each layer respectively, get the weighted user weight matrix Q u ,K u ,V u And the item weight matrix Q i ,K i ,V i , the formula is as follows: where I u is the user interaction matrix, I i is the item interaction matrix, is the vector representation of the k-th layer of user u, is the vector representation of the k-th layer of item i, Q u ,K u ,V u is the user weight matrix, Q i ,K i ,V i is the item weight matrix; S32, Q u K u Q i K i The weight matrix is transposed and multiplied to enter the activation function to obtain the attention score matrix, as follows: wherein A u is a user attention score matrix, A i is an item attention score matrix; S33, the obtained attention score matrix is multiplied with V u ,V i The final expression of each layer with weight is obtained by transposing multiplication, and the formula is as follows: e u =∑V u A u ,e i =∑V i A i , e u is the final representation with weights for each layer; S34, performing an addition operation to obtain a final weighted aggregation result as the recommendation result based on the graph convolutional network, and the formula is as follows: y LGCN recommendation results based on the graph convolution network. 4.The hybrid recommendation method of fusing graph convolutional neural network and factorization machine according to claim 1, characterized in that, S5 comprises: S51, combining the recommendation result based on the graph convolutional network and the recommendation result based on the factorization machine to obtain a fused recommendation result, and the formula is as follows: recommendation results for fusion; S52, calculate the number L of items in the recommendation list that the user has interacted with using the BPR Loss u ; S53, according to L u The evaluation index is calculated according to the following formula: Recall@K, which measures the number of items that the user has interacted with in the Top K, K = 20 recommendations in the recommendation list L u The proportion of the number of all items that the user has interacted with in the test set u indicates the user, and U is the total number of users; Wherein NDCG@K is a normalized discounted cumulative gain, which measures the relevance score of different positions of the recommendation list, and i represents the i th result in the list; S54, using the Adam optimizer, the user weight matrix Q is updated according to the evaluation index derived u ,K u ,V u , the item weight matrix Q i ,K i ,V i , the first-order weight ω, and the weight of the second-order feature interaction <V i ,V j > are updated.
Citation Information
Patent Citations
Commodity recommendation method based on user comments and satisfaction level embedding
CN111275521A
Recommendation method based on graph twin network
CN111881342A