A personalized dining recommendation method and system based on graph contrastive learning
By constructing a user-restaurant interaction graph and combining it with graph contrastive learning methods, and using collaborative relationship encoders and variational graph autoencoders for data augmentation, the problems of data sparsity and popularity bias in personalized dining recommendations are solved, resulting in more accurate restaurant recommendations.
Patent Information
- Application Number
- CN202411664749.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2044-11-20
AI Technical Summary
Existing graph contrastive learning techniques suffer from data sparsity and popularity bias in personalized dining recommendations, resulting in poor recommendation performance, especially for new users or new restaurants.
We employ a graph-based contrastive learning approach. By constructing a user-restaurant interaction graph, we utilize a collaborative relationship encoder and a variational graph autoencoder for data augmentation, add uniform and Gaussian noise, construct a contrastive task, and combine the Adam optimization algorithm to optimize the model and improve recommendation accuracy.
It significantly improves the personalization and accuracy of the recommendation system, effectively mitigates popularity bias, gains a deeper understanding of users' true intentions, and provides restaurant recommendations that better match user preferences.
Smart Images

Figure CN119598017B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of smart city service recommendation technology, specifically relating to a personalized dining recommendation method and system based on graph comparison learning. Background Technology
[0002] Smart cities utilize advanced information technologies, such as the Internet of Things, cloud computing, and big data, to intelligently manage and serve various aspects of a city, thereby improving urban operational efficiency, optimizing resource allocation, and promoting sustainable social development. The construction of smart cities involves not only intelligent urban management and services but also improved convenience for residents. Personalized dining recommendations are a specific application of the smart city concept in the catering service sector. Personalized dining recommendations refer to recommending suitable restaurants and dishes to users based on their historical consumption data, likes, comments, and favorites, using intelligent algorithms. However, in practical applications, popular restaurants are often selected and consumed by a large number of users, creating a dominant interaction record in the recommendation system. This can easily overlook users' potential interest in less popular restaurants, exacerbating the information cocoon effect and affecting the recommendation effectiveness. Therefore, understanding users' true needs is crucial for personalized dining recommendations.
[0003] In restaurant recommendation, traditional graph neural network models typically require large amounts of data for training to capture subtle changes in user preferences. However, in situations with sparse data, the model may fail to understand the user's true needs. Secondly, graph neural network models struggle to make accurate recommendations for new users or restaurants due to a lack of historical interaction data. In contrast, graph contrastive learning methods generate positive sample pairs by using graph data augmentation techniques, such as node / edge perturbation or subgraph sampling, and learn node embeddings through contrastive learning. The core idea is to leverage the rich information in the graph structure to uncover the complex relationships between users and restaurants through contrastive learning, mitigating the adverse effects of data sparsity and popularity bias on the recommendation system. Therefore, this invention proposes a graph contrastive learning-based recommendation model that effectively extracts supervisory signals using self-supervised learning, captures the complex relationships between users and restaurants through the graph structure, and generates more representative recommendation results, thereby improving the personalization and accuracy of the recommendation system. Summary of the Invention
[0004] To address the issue of data augmentation impacting the performance of personalized dining recommendation tasks in existing graph contrastive learning techniques, this invention provides a personalized dining recommendation method and system based on graph contrastive learning.
[0005] To achieve the above objectives, the present invention employs the following technical solutions:
[0006] A personalized dining recommendation method based on graph contrastive learning includes the following steps:
[0007] Step 1, User-Restaurant Interaction Graph Construction; Obtain data from restaurant review websites to construct a user-restaurant interaction graph;
[0008] Step 2, Collaborative Relationship Encoding; Construct a collaborative relationship encoder to capture the interaction features between users and restaurants, and learn the original embeddings of user nodes and restaurant nodes in a low-dimensional latent space.
[0009] Step 3: Learn the embedding of the bias-free channel; on the original embedding of the user-restaurant interaction graph learned in Step 2, add uniform noise generated in the embedding space to generate personalized embeddings for users and restaurants.
[0010] Step 4: Learn the embedding of structure-preserving channels; use the variational graph autoencoder (VGAE) as a graph generation model to perform data augmentation on the user-restaurant interaction graph to obtain the user-restaurant generated graph, and use the collaborative relationship encoder from Step 2 to learn the embedding of the user-restaurant generated graph.
[0011] Step 5, Construct the comparison task; Construct the comparison task using the personalized embeddings of users and restaurants obtained in Steps 3 and 4, as well as the embeddings of the user-restaurant generation graph.
[0012] Step 6, Model Building and Optimization: Combine the comparison task from Step 5 with the recommendation task to build a personalized dining recommendation model based on graph comparison learning. Then, use the Adam optimization algorithm to optimize the model to improve the recommendation effect.
[0013] Step 7, Output Recommendation Results: Based on the personalized dining recommendation model developed through graph comparison learning, generate recommendation results that match user preferences and provide these results to users and restaurant operators.
[0014] Furthermore, step 1 specifically includes the following steps:
[0015] Step 1.1: Based on the needs of the personalized dining recommendation task, obtain and organize user interaction data with restaurants from restaurant review websites. This data includes user ratings, visit frequency, review content, user basic information, and restaurant characteristic information (such as menu items, price range, etc.).
[0016] Step 1.2: Construct a user-restaurant interaction graph G = (U, V) using the interaction data, where each user and restaurant is considered a node; U = {u1, ..., u...} i ,...,u I}(|U|=I) represents the set of user nodes, V={v1,...,v j ,...,v J}(|V|=J) represents the set of restaurant nodes, and I and J represent the number of user nodes and restaurant nodes, respectively; construct the edge set N of the user-restaurant interaction graph G using the interaction data between users and restaurants; if user u i For restaurant v j If there is interaction (such as rating, access, etc.), then in the user node u i And restaurant node v j Create an edge n(u) between them i ,v j ).
[0017] Furthermore, step 2, which constructs a collaborative relationship encoder to capture the interaction features between users and restaurants and learns the original embeddings of user nodes and restaurant nodes in a low-dimensional latent space, specifically includes the following steps:
[0018] Step 2.1: Graph convolution is used to construct a collaborative relationship encoder, which is used for user u. i And restaurant v j Generate size is Embedded vector e i and e j d is the dimension of the latent space; define the embedding matrix. and Let these represent the embeddings of user nodes and restaurant nodes respectively; update the embedding vectors of user and restaurant nodes by aggregating information from neighboring nodes:
[0019]
[0020] Where l represents the number of embedding propagation layers, and All have A vector of dimension u, used to represent the distance from neighboring user / restaurant nodes to the central node u. i and v j Aggregated information;
[0021] The normalized adjacency matrix of the user restaurant interaction matrix A is obtained from equation (1).
[0022]
[0023] Step 2.2 integrates multiple embedding propagation layers, defining the embedding propagation process from layer (l-1) to layer l, as shown below:
[0024]
[0025] in, and They represent user u respectively i And restaurant node v jThe embedding in the l-th layer of the neural network; summing the embeddings from all layers to obtain the final embedding of the node:
[0026]
[0027] Furthermore, step 3, which involves adding uniform noise generated in the embedding space to the original embedding of the user-restaurant interaction graph learned in step 2, thereby generating personalized embeddings for users and restaurants, specifically includes the following steps:
[0028] Step 3.1: Learn the embedding e of node i in the d-dimensional embedding space. i To achieve the following data augmentations:
[0029] e′ i =e i +Δ′ i ,e″ i =e i +Δ″ i (5)
[0030] Among them, the added noise vector Δ′ i and Δ″ i Obey ||Δ|| 2 =0.1, this constraint makes Δ numerically equivalent to a point on a hypersphere with a radius of 0.1. For Δ, the following requirements also apply:
[0031]
[0032] Where ω represents a vector of dimension d, used to control the size of Δ; sign(e i ) represents a symbolic function that returns e. i The sign of Δ affects its direction.
[0033] These constraints make e i Δ′ and Δ″ lie in the same superoctet, therefore noise is added to e. i It will not cause significant deviations and can construct e i Enhancement with less information;
[0034] Step 3.2 involves adding different uniform random noise during the embedding aggregation process at each layer to obtain personalized embeddings for users and restaurants. This embedding learning involving noise can be described as follows:
[0035]
[0036] Where E′ represents the perturbation embedding obtained after multi-layer embedding aggregation, and L represents the number of aggregation layers. E represents the normalized adjacency matrix of the l-th layer. (0)This represents the initial node embedding matrix, i.e., the original user or restaurant node embeddings at the time of model input; Δ (l) This represents uniform random noise in the l-th layer;
[0037] Step 3.3: Add an embedding consistency loss function with a regularization term to optimize the representation of the user and restaurant interaction graph and avoid overfitting.
[0038]
[0039] Where λ is the regularization coefficient, used to adjust the relative importance of embedding consistency loss and regularization loss in the total loss.
[0040] Furthermore, step 4 involves learning the embedding of structure-preserving channels; using a variational graph autoencoder (VGAE) as a graph generation model to augment the user-restaurant interaction graph, resulting in a user-restaurant generated graph, and then using the collaborative relationship encoder from step 2 to learn its embedding. Specifically, this includes the following steps:
[0041] Step 4.1, in the encoding stage, the distribution parameters (mean and variance) of the latent variables are learned using the collaborative relation encoder, and samples are taken from the learned distribution;
[0042] Step 4.2, in the decoding stage, the decoder reconstructs the user-restaurant interaction graph based on the generated mean vector and adds the standard deviation of Gaussian noise to obtain the user-restaurant generated graph. The loss in this step is defined as:
[0043]
[0044] in, This represents the KL divergence between the node embedding distribution and the standard Gaussian distribution; This represents a cross-entropy loss, used to quantify the difference between the user-restaurant generation graph and the user-restaurant interaction graph;
[0045] Step 4.3 then utilizes the collaborative relationship encoder to learn the embedding of the user-restaurant generation graph.
[0046] Further, in step 5, the comparison task is constructed; the personalized embeddings of users and restaurants obtained in steps 3 and 4, as well as the embeddings of the user-restaurant generation graph, are used to construct the comparison task. Specifically, different embeddings of the same node are considered as positive sample pairs, i.e., (e i ′,e i ")|u i ∈U, treat the embeddings of any two distinct nodes as negative sample pairs, i.e. (e i ′,e i "′)|u i ,u i′ ∈U,ui ≠u i′ The objective is to maximize the consistency between positive sample pairs and minimize the consistency between negative sample pairs. The user's contrastive loss function is as follows:
[0047]
[0048] The cosine similarity function s(·) is used to measure the similarity between two embedding vectors, and the hyperparameter τ is called the temperature coefficient in softmax; similarly, the contrast loss of the restaurant is calculated. Combining the two types of losses above, we obtain the objective function for the comparison task.
[0049] Furthermore, step 6, model construction and optimization, combines the comparison task from step 5 with the recommendation task to construct a personalized dining recommendation model based on graph comparison learning. The Adam optimization algorithm is then used to optimize the model to improve the recommendation performance, including the following steps:
[0050] Step 6.1, the recommendation task maximizes the predicted ratings of highly interactive restaurant nodes. Predicted ratings for restaurant nodes with low interactivity The differences between them are used to drive the model to learn a more accurate ranking. The loss function for this process is expressed as:
[0051]
[0052] Among them, O=(u,i,j)|(u,i)∈O + ,(u,j)∈O - This represents the training data, O + O represents the observed interaction. - =U×I / O + Indicates unobserved interactions;
[0053] Step 6.2: Combine the comparison task and the recommendation task to construct a personalized dining recommendation model based on graph comparison learning;
[0054] Step 6.3: The Adam optimization algorithm is used to optimize the model. The overall optimization model is shown in Equation (14), which includes two parts: the upper layer and the lower layer.
[0055] Upper layer: Consists of the losses from the recommendation task (Equation (11)) and the comparison task (Equation (10)):
[0056]
[0057] Where Θ represents the model parameter set in the recommendation task, and λ1 and λ2 are hyperparameters that control the SSL and regularization strength, respectively;
[0058] The lower layer consists of losses from the deviation correction channel (Equation (8)) and the structure retention channel (Equation (9)).
[0059]
[0060] By jointly optimizing the losses of the upper and lower layers, the best training results can be achieved.
[0061] Furthermore, in step 7, the recommendation results are output; based on the personalized dining recommendation model developed through graph comparison learning, recommendation results that match user preferences are generated and provided to users and restaurant operators. This specifically includes the following steps:
[0062] Step 7.1: When a user generates a dining request, a personalized dining recommendation model based on graph contrastive learning is used to generate a corresponding recommendation sequence t based on the user's personal preferences and historical consumption behavior. n :
[0063]
[0064] in, Used to predict user u a For restaurant v b The user's preference values are sorted from highest to lowest based on their preference values for different restaurants. The top n restaurants are then selected to generate a recommendation sequence t. n ;
[0065] Step 7.3 provides personalized dining recommendations to users and restaurant operators; helps users quickly find restaurants that match their personal tastes and needs; and helps restaurant operators develop more targeted marketing strategies to attract customers and drive business growth.
[0066] A personalized dining recommendation system based on graph contrastive learning includes a computer processor and memory, a user-restaurant interaction graph construction unit, a collaborative relationship encoding unit, an embedding unit for learning bias-free channels, an embedding unit for learning structure-preserving channels, a contrastive task construction unit, a model construction and optimization unit, and a recommendation result output unit.
[0067] The user-restaurant interaction graph construction unit performs step 1, obtaining data from restaurant review websites, including user likes, comments, favorites, and historical consumption records. Using users and restaurants as nodes, the user-restaurant interaction graph structure is constructed using the interaction data between users and restaurants.
[0068] The collaborative relationship encoding unit performs step 2 to construct a collaborative relationship encoder, which is used to capture the interaction features between users and restaurants and learn the original embeddings of user nodes and restaurant nodes in a low-dimensional latent space.
[0069] Learn the embedding unit of the bias-free channel, and perform step 3. Add uniform noise generated in the embedding space to the original embedding of the user-restaurant interaction graph learned in step 2 to generate personalized embeddings for users and restaurants.
[0070] The embedding unit of the structure-preserving channel is learned, and step 4 is executed. The variational graph autoencoder (VGAE) is used as the graph generation model user-restaurant interaction graph for data augmentation to obtain the user-restaurant generation graph. The embedding of the user-restaurant generation graph is learned using the collaborative relationship encoder in step 2.
[0071] In the comparison task construction unit, step 5 is executed, using the personalized embeddings of users and restaurants and the embeddings of the user-restaurant generation graph obtained in steps 3 and 4 to construct the comparison task.
[0072] The model building and optimization unit executes step 6, which combines the comparison task in step 5 with the recommendation task to build a personalized dining recommendation model based on graph comparison learning and uses the Adam optimization algorithm to optimize the model to improve the recommendation effect.
[0073] The recommendation result output unit executes step 7, generating recommendation results that match user preferences based on the personalized dining recommendation model learned from the graph comparison learning above, and providing the recommendation results to users and restaurant operators.
[0074] Compared with the prior art, the present invention has the following advantages:
[0075] This invention presents a personalized dining recommendation method based on graph contrastive learning. Through two different data augmentation methods, it effectively mitigates the adverse effects of popularity bias on personalized restaurant recommendations.
[0076] This invention presents a personalized dining recommendation method based on graph contrastive learning. It effectively extracts supervisory signals using self-supervised learning and captures the complex relationship between users and restaurants through graph structures, thereby gaining a deeper understanding of users' true intentions. This method significantly improves the personalization and accuracy of the recommendation system. Attached Figure Description
[0077] Figure 1 This is a model diagram of the personalized dining recommendation system of the present invention;
[0078] Figure 2 This is a computer implementation system structure diagram of the personalized dining recommendation system of the present invention;
[0079] Figure 3 This is a flowchart of the personalized dining recommendation method of the present invention. Detailed Implementation
[0080] To gain a deeper understanding of this invention, we will provide a comprehensive and detailed description. However, this invention has various implementations and is not limited to the specific examples listed herein. These examples are presented to enhance a full understanding of the disclosure of this invention.
[0081] The personalized dining recommendation method based on graph comparison learning described in this invention is implemented through a computer program, and will be described below according to... Figure 3 The illustrated process details the specific implementation of the technical solution proposed in this invention. This technical solution is used for recommendations on the Yelp dataset, which comes from the Yelp platform and includes user ratings, reviews, business information (such as name, address, category, etc.), and relationships between users. We divide the dataset into three parts: a training set, a validation set, and a test set, in a ratio of 7:1:2. We adopt a full-rank evaluation protocol; for each test user, the positive samples in the test set and all non-interactive restaurants are tested and ranked together.
[0082] Example 1
[0083] Step 1: Constructing the User-Restaurant Interaction Graph. Obtain data from restaurant review websites to construct a user-restaurant interaction graph. The specific steps are as follows:
[0084] Step 1.1: Based on the needs of the personalized dining recommendation task, obtain and organize user interaction data with restaurants from restaurant review websites. This data includes user ratings, visit frequency, review content, user basic information, and restaurant characteristic information (such as menu items, price range, etc.).
[0085] Step 1.2: Construct a user-restaurant interaction graph G = (U, V) using the above information, where each user and restaurant is considered a node. U = {u1, ..., u...} i ,...,u I}(|U|=I) represents the set of user nodes, V={v1,...,v j ,...,v J}(|V|=J) represents the set of restaurant nodes, where I and J represent the number of user nodes and restaurant nodes, respectively. The edge set N of the user-restaurant interaction graph G is constructed using the interaction data between users and restaurants. If user u i For restaurant v j If there is interaction (such as rating, access, etc.), then in the user node u i And restaurant node v j Create an edge n(u) between them i ,v j ).
[0086] Step 2, Collaborative Relationship Encoding. A collaborative relationship encoder is constructed to capture the interaction features between users and restaurants, learning the original embeddings of user nodes and restaurant nodes in a low-dimensional latent space. The specific steps are as follows:
[0087] Step 2.1: Graph convolution is used to construct a collaborative relationship encoder, which is used for user u. i And restaurant v j Generate size is Embedded vector e i and e j d is the dimension of the latent space; define the embedding matrix. and Let these represent the embeddings of user nodes and restaurant nodes, respectively. The embedding vectors of user and restaurant nodes are updated by aggregating information from neighboring nodes.
[0088]
[0089] Where l represents the number of embedding propagation layers, and All have A vector of dimension u, used to represent the distance from neighboring user / restaurant nodes to the central node u. i and v j Aggregated information;
[0090] The normalized adjacency matrix of the user restaurant interaction matrix A is obtained from equation (1).
[0091]
[0092] Step 2.2 integrates multiple embedding propagation layers, defining the embedding propagation process from layer (l-1) to layer l, as shown below:
[0093]
[0094] in, and They represent user u respectively i And restaurant node v j The embedding in the l-th layer of the neural network; summing the embeddings from all layers to obtain the final embedding of the node:
[0095]
[0096] Step 3 involves learning the embedding of the bias-free channel. Based on the user and restaurant node embeddings learned in Step 2, uniform noise generated in the embedding space is added to create personalized embeddings for users and restaurants. The specific steps are as follows:
[0097] Step 3.1: Learn the embedding e of node i in the d-dimensional embedding space. i To achieve the following data augmentations:
[0098] e′ i =e i +Δ′ i ,e″ i =e i +Δ″ i (5)
[0099] The added noise vector Δ′ i and Δ″ i Obey ||Δ|| 2 =0.1, this constraint makes Δ numerically equivalent to a point on a hypersphere with a radius of 0.1. For Δ, the following requirements also apply:
[0100]
[0101] Where ω represents a vector of dimension d, used to control the size of Δ; sign(e i ) represents a symbolic function that returns e. i The sign of Δ affects its direction.
[0102] These constraints make e i Δ′ and Δ″ lie in the same superoctet, therefore noise is added to e. i It will not cause significant deviations and can construct e i Enhancement with less information;
[0103] Step 3.2 involves adding different uniform random noise during the embedding aggregation process at each layer to obtain personalized embeddings for users and restaurants. This embedding learning involving noise can be described as follows:
[0104]
[0105] Where E′ represents the perturbation embedding obtained after multi-layer embedding aggregation, and L represents the number of aggregation layers. E represents the normalized adjacency matrix of the l-th layer. (0) This represents the initial node embedding matrix, i.e., the original user or restaurant node embeddings at the time of model input; Δ (l) This represents uniform random noise in the l-th layer;
[0106] Step 3.3: Add an embedding consistency loss function with a regularization term to optimize the embedding of user and restaurant interaction graphs and avoid overfitting.
[0107]
[0108] Where λ is the regularization coefficient, used to adjust the relative importance of embedding consistency loss and regularization loss in the total loss.
[0109] Step 4: Learn the embeddings of structure-preserving channels. A variational graph autoencoder (VGAE) is used as the graph generation model to augment the user-restaurant interaction graph, resulting in a user-restaurant generated graph. The co-operation encoder from Step 2 is then used to learn its embeddings. The specific steps are as follows:
[0110] Step 4.1, in the encoding stage, the distribution parameters (mean and variance) of the latent variables are learned using the collaborative relation encoder, and samples are taken from the learned distribution;
[0111] Step 4.2, in the decoding stage, the decoder reconstructs the user-restaurant interaction graph based on the generated mean vector and adds the standard deviation of Gaussian noise to obtain the user-restaurant generated graph. The loss in this step is defined as:
[0112]
[0113] in, This represents the KL divergence between the node embedding distribution and the standard Gaussian distribution; This represents a cross-entropy loss, used to quantify the difference between the user-restaurant generation graph and the user-restaurant interaction graph;
[0114] Step 4.3 then utilizes the collaborative relationship encoder to learn the embedding of the user-restaurant generation graph.
[0115] Step 5, Comparison Task Construction. The comparison task is constructed using the personalized embeddings of users and restaurants obtained in Steps 3 and 4, as well as the embeddings of the user-restaurant generation graph. The specific steps are as follows:
[0116] Different embeddings of the same node are considered positive sample pairs, i.e. (e i ′,e i ")|u i ∈U, treat the embeddings of any two distinct nodes as negative sample pairs, i.e. (e i ′,e i "′)|u i ,u i′ ∈U,u i ≠u i′ The goal is to maximize the consistency between positive sample pairs and minimize the consistency between negative sample pairs. The user's contrastive loss function is as follows:
[0117]
[0118] The cosine similarity function s(·) is used to measure the similarity between two embedding vectors, and the hyperparameter τ is called the temperature coefficient in softmax; similarly, the contrast loss of the restaurant is calculated. Combining the two types of losses above, we obtain the objective function for the comparison task.
[0119] Step 6, Model Building and Optimization. The comparison task from Step 5 is combined with the recommendation task to build a personalized dining recommendation model based on graph comparison learning. The Adam optimization algorithm is then used to optimize the model to improve recommendation performance. The specific steps are as follows:
[0120] Step 6.1, the recommendation task maximizes the predicted ratings of highly interactive restaurant nodes. Predicted ratings for restaurant nodes with low interactivity The differences between them are used to drive the model to learn a more accurate ranking. The loss function for this process is expressed as:
[0121]
[0122] Among them, O=(u,i,j)|(u,i)∈O + ,(u,j)∈O - This represents the training data, O + O represents the observed interaction. - =U×I / O + Indicates unobserved interactions;
[0123] Step 6.2: Combine the comparison task and the recommendation task to construct a personalized dining recommendation model based on graph comparison learning;
[0124] Step 6.3: The Adam optimization algorithm is used to optimize the model. The overall optimization model is shown in Equation (14), which includes two parts: the upper layer and the lower layer.
[0125] Upper layer: Consists of the losses from the recommendation task (Equation (11)) and the comparison task (Equation (10)):
[0126]
[0127] Where Θ represents the model parameter set in the recommendation task, and λ1 and λ2 are hyperparameters that control the SSL and regularization strength, respectively;
[0128] The lower layer consists of losses from the deviation correction channel (Equation (8)) and the structure retention channel (Equation (9)).
[0129]
[0130] By jointly optimizing the losses of the upper and lower layers, the best training results can be achieved.
[0131] Step 7, Output Recommendation Results. Based on the personalized dining recommendation model developed through graph comparison learning, recommendations that match user preferences are generated and provided to both users and restaurant operators. The specific steps are as follows:
[0132] Step 7.1: When a user generates a dining request, a personalized dining recommendation model based on graph contrastive learning is used to generate a corresponding recommendation sequence t based on the user's personal preferences and historical consumption behavior. n :
[0133]
[0134] in, Used to predict user u a For restaurant v b The user's preference values are sorted from highest to lowest based on their preference values for different restaurants. The top n restaurants are then selected to generate a recommendation sequence t. n ;
[0135] Step 7.2 provides personalized dining recommendations to users and restaurant operators; helps users quickly find restaurants that match their personal tastes and needs; and helps restaurant operators develop more targeted marketing strategies to attract customers and drive business growth.
[0136] Example 2
[0137] To verify the effectiveness and advancement of the proposed technical solution, the performance of this invention is compared with that of lightweight graph convolutional models LightGCN and GCCF, and graph contrastive collaborative filtering models NCL and SGL. Recall@20 and normalized discount cumulative gain NDCG@20 are used as evaluation metrics for recommendation performance. The personalized dining recommendation results of the above method are evaluated using the Yelp dataset in the examples, and the results are shown in Table 1.
[0138]
[0139] As can be seen from the results in the table, the method of the present invention can obtain more reliable recommendation results when making personalized dining recommendations.
[0140] Example 3
[0141] like Figure 2 As shown, a personalized dining recommendation system based on graph contrastive learning includes a computer processor and memory, a user-restaurant interaction graph construction unit, a collaborative relationship encoding unit, an embedding unit for learning bias-free channels, an embedding unit for learning structure-preserving channels, a contrastive task construction unit, a model construction and optimization unit, and a recommendation result output unit.
[0142] The user-restaurant interaction graph construction unit performs step 1, obtaining data from restaurant review websites, including user likes, comments, favorites, and historical consumption records, to construct the user-restaurant graph structure.
[0143] The collaborative relationship encoding unit performs step 2 to construct a collaborative relationship encoder, which is used to capture the interaction features between users and restaurants and learn the embeddings of user nodes and restaurant nodes in a low-dimensional latent space.
[0144] Learn the embedding unit of the bias-free channel, execute step 3, add uniform noise generated in the embedding space to the original embedding learned in step 2, thereby generating personalized embeddings for users and restaurants.
[0145] The embedding unit of the learning structure-preserving channel is executed in step 4. The variational graph autoencoder (VGAE) is used as the graph generation model to perform data augmentation on the user-restaurant interaction graph constructed in step 1 to obtain the user-restaurant generated graph. The embedding of the user-restaurant generated graph is then learned using the collaborative relationship encoder in step 2.
[0146] In the comparison task construction unit, step 5 is executed, using the personalized embeddings of users and restaurants and the embeddings of the user-restaurant generation graph obtained in steps 3 and 4 to construct the comparison task.
[0147] The model building and optimization unit executes step 6, which combines the comparison task in step 5 with the recommendation task to build a personalized dining recommendation model based on graph comparison learning and uses the Adam optimization algorithm to optimize the model to improve the recommendation effect.
[0148] The recommendation result output unit executes step 7, generating recommendation results that match user preferences based on the personalized dining recommendation model learned from the graph comparison learning above, and providing the recommendation results to users and restaurant operators.
[0149] Contents not described in detail in this specification are prior art known to those skilled in the art. Although illustrative specific embodiments of the invention have been described above to facilitate understanding by those skilled in the art, it should be understood that the invention is not limited to the scope of the specific embodiments. Various modifications are readily apparent to those skilled in the art as long as they fall within the spirit and scope of the invention as defined and determined by the appended claims, and all inventions utilizing the concept of this invention are protected.
Claims
1. A personalized dining recommendation method based on graph contrastive learning, characterized in that, Includes the following steps: Step 1: Obtain data from restaurant review websites and construct a user-restaurant interaction graph; Step 2: Construct a collaborative relationship encoder to capture the interaction features between users and restaurants, and learn the original embeddings of user nodes and restaurant nodes in a low-dimensional latent space. Step 3: On the original embedding of the user-restaurant interaction graph learned in Step 2, add uniform noise generated in the embedding space to generate personalized embeddings for users and restaurants. Step 4: Use Variational Graph Autoencoder (VGAE) as a graph generation model to augment the user-restaurant interaction graph to obtain the user-restaurant generated graph, and use the collaborative relationship encoder from Step 2 to learn the embedding of the user-restaurant generated graph. Step 5: Construct a comparison task using the personalized embeddings of users and restaurants obtained in Steps 3 and 4, as well as the embeddings of the user-restaurant generation graph. Step 6: Combine the comparison task from Step 5 with the recommendation task to build a personalized dining recommendation model based on graph comparison learning, and use the Adam optimization algorithm to optimize the model and improve the recommendation effect. Step 7: Based on the personalized dining recommendation model of graph comparison learning described above, generate recommendation results that match user preferences and provide the recommendation results to users and restaurant operators. Step 5, which utilizes the personalized embeddings of users and restaurants obtained in steps 3 and 4, as well as the embeddings of the user-restaurant generation graph, to construct the comparison task, specifically involves treating different embeddings of the same node as positive sample pairs, i.e. The embeddings of any two different nodes are considered as negative sample pairs, i.e. The objective is to maximize the consistency between positive sample pairs and minimize the consistency between negative sample pairs. The user's contrastive loss function is as follows: (10) Using the cosine similarity function Hyperparameters are used to measure the similarity between two embedding vectors. In softmax, this is called the temperature coefficient; similarly, it's used to calculate the contrast loss of the restaurant. Combining the two types of losses mentioned above, we obtain the objective function for the comparison task. .
2. The personalized dining recommendation method based on graph comparison learning according to claim 1, characterized in that: Step 1, which involves acquiring data from restaurant review websites and constructing a user-restaurant interaction graph, specifically includes the following steps: Step 1.1: Based on the needs of the personalized dining recommendation task, obtain and organize user interaction data with restaurants from restaurant review websites; Step 1.2: Construct a user-restaurant interaction graph using interactive data. In this context, each user and restaurant is considered a node; Represents a set of user nodes. Represents the set of restaurant nodes. and These represent the number of user nodes and restaurant nodes, respectively; a user-restaurant interaction graph is constructed using the interaction data between users and restaurants. edge set If the user For restaurants If there is interaction, then at the user node and restaurant nodes Create an edge between them .
3. The personalized dining recommendation method based on graph comparison learning according to claim 2, characterized in that: Step 2, which constructs a collaborative relationship encoder to capture the interaction features between users and restaurants and learns the original embeddings of user nodes and restaurant nodes in a low-dimensional latent space, specifically includes the following steps: Step 2.1: Graph convolution is used to construct a collaborative relationship encoder, which is used for users... And restaurant Generate size is Embedded vector and , Let be the dimension of the latent space; define the embedding matrix. and Let these represent the embeddings of user nodes and restaurant nodes respectively; update the embedding vectors of user and restaurant nodes by aggregating information from neighboring nodes: (1) in, Indicates the number of embedding propagation layers. and All have A vector of dimension, used to represent the distance from neighboring user / restaurant nodes to the central node. and Aggregated information; The user-restaurant interaction matrix is obtained from equation (1). Normalized adjacency matrix : (2) Step 2.2, integrate multiple embedding propagation layers, defining the propagation layer from the ( ) -1) layer to the The layer embedding propagation process is as follows: (3) in, and Representing users respectively and restaurant nodes In the neural network Layer embeddings; sum the embeddings of all layers to obtain the final embedding of the node: (4)。 4. The personalized dining recommendation method based on graph comparison learning according to claim 3, characterized in that: Step 3, which involves adding uniform noise generated in the embedding space to the original embedding of the user-restaurant interaction graph learned in step 2, to generate personalized embeddings for users and restaurants, specifically includes the following steps: Step 3.1, based on Nodes learned in dimensional embedding space Embedded To achieve the following data augmentations: (5) Among them, the added noise vector and obey ,for The following requirements also apply: (6) in, The dimension is The vector used to control Size; Indicates a symbolic function, returns The symbols, and thus the influence The direction; Step 3.2 involves adding different uniform random noises during the embedding aggregation process at each layer to obtain personalized embeddings for users and restaurants. The embedding learning involving noise is described as follows: (7) in, This represents the perturbation embedding obtained after multi-layer embedding aggregation. Indicates the number of aggregation layers. Indicates the first The normalized adjacency matrix of the layer, This represents the initial node embedding matrix, i.e., the original user or restaurant node embeddings when the model is input. Indicates the first Uniform random noise in the layer; Step 3.3: Add an embedding consistency loss function with a regularization term to optimize the representation of the user and restaurant interaction graph and avoid overfitting. (8) in, It is the regularization coefficient, used to adjust the relative importance of embedding consistency loss and regularization loss in the total loss; This represents the set of model parameters in the recommendation task.
5. The personalized dining recommendation method based on graph comparison learning according to claim 4, characterized in that: Step 4 uses the Variational Graph Autoencoder (VGAE) as a graph generation model to augment the user-restaurant interaction graph, obtaining a user-restaurant generated graph. The embedding of the user-restaurant generated graph is then learned using the collaborative relationship encoder from step 2. Specifically, this includes the following steps: Step 4.1, in the encoding stage, the distribution parameters of the latent variables are learned using the collaborative relation encoder, and samples are taken from the learned distribution; Step 4.2, in the decoding stage, the decoder reconstructs the user-restaurant interaction graph based on the generated mean vector and adds the standard deviation of Gaussian noise to obtain the user-restaurant generated graph. The loss in this step is defined as: (9) in, This represents the KL divergence between the node embedding distribution and the standard Gaussian distribution; This represents a cross-entropy loss, used to quantify the difference between the user-restaurant generation graph and the user-restaurant interaction graph; Step 4.3 then utilizes the collaborative relationship encoder to learn the embedding of the user-restaurant generation graph.
6. The personalized dining recommendation method based on graph comparison learning according to claim 5, characterized in that: Step 6 combines the comparison task from step 5 with the recommendation task to construct a personalized dining recommendation model based on graph comparison learning. The Adam optimization algorithm is then used to optimize the model and improve the recommendation performance. This includes the following steps: Step 6.1, the recommendation task maximizes the predicted ratings of highly interactive restaurant nodes. Predicted ratings for restaurant nodes with low interactivity The differences between them are used to drive the model to learn a more accurate ranking. The loss function for this process is expressed as: (11) in, This represents the training data. Represents the observed interactions, Indicates unobserved interactions; Step 6.2: Combine the comparison task and the recommendation task to construct a personalized dining recommendation model based on graph comparison learning; Step 6.3: The Adam optimization algorithm is used to optimize the model. The overall optimization model is shown in Equation (14), which includes two parts: the upper layer and the lower layer. Upper layer: Consists of the losses from the recommendation task and the comparison task. (12) in, This represents the set of model parameters in the recommendation task. and These are hyperparameters that control SSL and regularization strength respectively; The lower layer consists of losses from the deviation correction channel and the structure retention channel. (13) (14) By jointly optimizing the losses of the upper and lower layers, the best training results can be achieved.
7. The personalized dining recommendation method based on graph comparison learning according to claim 6, characterized in that: Step 7, recommendation result output; based on the personalized dining recommendation model of graph comparison learning described above, a recommendation result that matches user preferences is generated and provided to users and restaurant operators, specifically including the following steps: Step 7.1: When a user has a dining need, a personalized dining recommendation model based on graph comparison learning is used to generate a corresponding recommendation sequence based on the user's personal preferences and historical consumption behavior. : (15) (16) in, Used to predict users For restaurants The user's preference values are sorted from highest to lowest based on their preference values for different restaurants. The top n restaurants are then selected to generate a recommendation sequence. ; Step 7.2: Provide personalized dining recommendations to users and restaurant operators.
8. A personalized dining recommendation system based on graph comparison learning, characterized in that: The system includes a personalized dining recommendation method based on graph contrastive learning as described in any one of claims 1 to 7. The personalized dining recommendation system includes a computer processor and memory, a user-restaurant interaction graph construction unit, a collaborative relationship encoding unit, an embedding unit for learning bias-free channels, an embedding unit for learning structure-preserving channels, a contrastive task construction unit, a model construction and optimization unit, and a recommendation result output unit. The user-restaurant interaction graph construction unit obtains data from restaurant review websites, uses users and restaurants as nodes, and constructs a user-restaurant interaction graph structure using the interaction data between users and restaurants. The collaborative relationship encoding unit constructs a collaborative relationship encoder to capture the interaction features between users and restaurants and learn the original embeddings of user nodes and restaurant nodes in a low-dimensional latent space. The learning debiased channel embedding unit adds uniform noise generated in the embedding space to the original embedding of the user-restaurant interaction graph, thereby generating personalized embeddings for users and restaurants. The learning structure preserves the embedding unit of the channel, uses a variational graph autoencoder as a graph generation model to perform data augmentation on the user-restaurant interaction graph to obtain a user-restaurant generated graph, and uses a collaborative relationship encoder to learn its embedding. The comparison task construction unit constructs the comparison task by utilizing the personalized embedding of users and restaurants and the embedding of user-restaurant generated graphs. The model building and optimization unit combines the comparison task with the recommendation task to build a personalized dining recommendation model based on graph comparison learning and uses the Adam optimization algorithm to optimize the model to improve the recommendation effect. The recommendation result output unit generates recommendation results that match user preferences based on the personalized dining recommendation model of graph comparison learning, and provides the recommendation results to users and restaurant operators.
Citation Information
Patent Citations
Conditional variation auto-encoder-based neighborhood feature enhancement method on multi-channel heterogeneous attribute graph
CN117473161A
Knowledge perception-based graph self-supervised learning recommendation method
CN117634600A