POI recommendation method and system based on graph attention network
By constructing User-User and POI-POI graphs and utilizing graph attention networks and LSTM/Transformer models, the problems of slow computation speed and incomplete user preferences in existing POI recommendation models are solved, achieving more accurate POI recommendations.
Patent Information
- Application Number
- CN202310919421.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-25
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2043-07-25
AI Technical Summary
Existing POI recommendation models are slow to compute, do not fully consider the importance of users' second-order neighbors and adjacent POIs, and do not fully extract user preferences.
We employ a graph attention network-based approach to construct User-User and POI-POI graphs. By using graph attention networks to obtain the attention weights of users and POIs, and combining LSTM and Transformer models, we capture the second-order social features of users and the intrinsic relationship features of POIs. Furthermore, we integrate spatiotemporal information to calculate the personalized preferences of users.
It improves the accuracy and speed of POI recommendations, comprehensively captures user features and POI features, and enhances the precision of recommendations.
Smart Images

Figure CN116955847B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of smart tourism technology, specifically relating to a POI recommendation method based on graph attention networks. This invention also relates to a POI recommendation system based on graph attention networks. Background Technology
[0002] POI stands for "Point of Interest," which can be a hospital, a restaurant, a park, etc. In recent years, with the rapid development of mobile devices and the significant increase in social networking services, people's lives have become more convenient, and their social relationships have been strengthened. Furthermore, with the development of location technology, location-based social networks (LBSNs) have emerged. LBSNs contain a wealth of information, including user check-in information and social data. This information can help us study user behavior patterns, but how to better utilize this information to serve the next POI recommendation task is a current research hotspot. With the increasing demand for personalized services, next POI recommendations are being applied across various industries. For example, in ride-hailing services, drivers can use recommendations to predict customer pick-up points.
[0003] Unlike traditional movie and music recommendations, next-generation POI recommendations are highly spatial and temporal, meaning their effectiveness is greatly influenced by geographical and temporal factors, requiring careful consideration in modeling. Existing POI recommendation systems largely consider the impact of geographical, temporal, and social factors, thereby improving recommendation performance.
[0004] However, existing POI recommendation models still have some limitations. First, regarding the chosen model, most existing methods are based on RNN models. RNN models undoubtedly have a natural advantage in capturing the sequentiality of a user's historical check-in sequences, but this very advantage leads to their slow computation speed. Second, existing methods do not fully consider the user's social factors. In the user modeling process, only the user's first-order neighbors are incorporated, but second-order neighbors often have a significant, sometimes crucial, influence on the user. Third, existing methods do not adequately consider the importance between adjacent POIs, resulting in inaccurate POI representations. Finally, existing methods do not comprehensively extract user preferences, failing to fully explore user preferences. Summary of the Invention
[0005] The purpose of this invention is to provide a POI recommendation method based on graph attention networks, which can extract user and POI features more comprehensively and provide more accurate recommendation results.
[0006] Another objective of this invention is to provide a POI recommendation system based on graph attention networks.
[0007] The first technical solution adopted in this invention is a POI recommendation method based on graph attention networks, comprising the following steps:
[0008] Step 1: Obtain user's historical check-in information and user's social relationship information;
[0009] Step 2: Based on the user's social relationship information obtained in Step 1, obtain the user's social characteristics;
[0010] Step 3: Based on the POI records in the user's historical check-in information obtained in Step 1, obtain the inherent relationship characteristics of the POIs and update them;
[0011] Step 4: Based on the user's historical check-in information obtained in Step 1, obtain the user's preference characteristics;
[0012] Step 5: Input the social features of users obtained in Step 2, the intrinsic relationship features of POIs obtained in Step 3, and the preference features of users obtained in Step 4 into the trained deep learning model to obtain the predicted list of the top N POIs.
[0013] The first technical solution of the present invention is further characterized in that,
[0014] Step 2 specifically involves: First, constructing a User-User graph based on user social relationship information, and then using a graph attention network to obtain the attention weight of each user, thereby obtaining the user's first-order social features.
[0015] U neighbors-1 =GAT(G user )
[0016] Among them, G user Represents a User-User graph;
[0017] Next, the target user and its n neighbors are randomly sorted, and the second-order social features of the user are obtained through LSTM:
[0018]
[0019] Among them, U target Representing the target users, n represent the target user's neighbors.
[0020] Step 3 specifically includes the following steps:
[0021] Step 3.1: Extract the POIs that the user has checked in from the user's historical check-in information, set a distance threshold k to construct a POI-POI graph, use a graph attention network to obtain the attention weight of each POI, and then update the POI embedding.
[0022] Step 3.2: Replace the POIs in the user's historical check-in sequence with the POI Embedding updated by the graph attention network obtained in Step 3.1, thereby obtaining the intrinsic relationship features of the POIs in the user's historical check-in sequence. Then, use the Encoder module in the Transformer model to capture the serialization information.
[0023]
[0024] in, For POI embedding that incorporates location feature vectors, This refers to the POI embedding updated by the Transformer.
[0025] Step 3.3: Capture spatiotemporal information based on the temporal and spatial distances between adjacent POIs in the user's historical check-in sequence, and design a fusion function to fuse the POI Embedding obtained in Step 3.2 with the spatiotemporal information. The fusion function is as follows:
[0026]
[0027] Where T and D are the temporal distance and spatial distance, respectively, α is the temporal aggregation weight, and ω is the aggregation weight coefficient between two adjacent POIs.
[0028] Step 4 specifically involves: based on the user's historical check-in information, calculating the spatial distance between adjacent POIs, the time the user spends at each POI, and the frequency (number of visits) of the user to the same POI. Then, time, spatial distance, and frequency are normalized respectively, serving as the spatiotemporal and frequency weights for the corresponding POIs. Finally, the user's three personalized preferences are calculated.
[0029] T,S,F = Softmax(t,s,f)
[0030]
[0031]
[0032]
[0033] Where T, S, and F are time, space, and frequency weight matrices, respectively; TUP, SUP, and FUP are time, space, and frequency personalized preferences, respectively; and P is the POI Embedding matrix.
[0034] The second technical solution adopted in this invention is: a POI recommendation system based on graph attention networks, comprising:
[0035] The user information acquisition module is used to acquire users' historical check-in information and users' social relationship information.
[0036] The user social relationship acquisition module is used to acquire the user's social characteristics and obtain the updated user's Embedding.
[0037] The POI information acquisition module is used to acquire POI records from the user's historical check-in information;
[0038] The POI intrinsic relationship acquisition module is used to acquire the intrinsic relationships between adjacent POIs and update the POI's embedding.
[0039] The module for obtaining serialized information from the user's historical check-in sequence is used to obtain serialized information from the user's historical check-in sequence.
[0040] The spatiotemporal information fusion module is used to fuse spatiotemporal information from the user's historical check-in sequence to better express the POI embedding;
[0041] The user personalized preference acquisition module is used to acquire the user's spatiotemporal and frequency preferences, and then concatenate them into the user's personalized preferences.
[0042] The model training module is used to train deep learning models;
[0043] The POI prediction module is used to output a list of recommended POIs.
[0044] The second technical solution of the present invention is further characterized in that,
[0045] The user social relationship acquisition module includes, firstly, constructing a User-User graph based on user social relationship information, and then using a graph attention network to obtain the attention weight of each user, thereby obtaining the user's first-order social features:
[0046] U neighbors-1 =GAT(G user )
[0047] Among them, G user Represents a User-User graph;
[0048] Next, the target user and its n neighbors are randomly sorted, and the second-order social features of the user are obtained through LSTM:
[0049]
[0050] Among them, U target Representing the target users, n represent the target user's neighbors.
[0051] The POI intrinsic relationship acquisition module includes extracting the POIs that the user has checked in from the user's historical check-in information, setting a distance threshold k to construct a POI-POI graph, using a graph attention network to obtain the attention weight of each POI, and then updating each POI Embedding.
[0052] The module for obtaining serialized information from the user's historical check-in sequence includes replacing the POIs in the user's historical check-in sequence with POI embeddings updated by a graph attention network, thereby obtaining the inherent relationship features of the POIs in the user's historical check-in sequence, and then using the Encoder module in the Transformer model to capture the serialized information.
[0053]
[0054] in, For POI embedding that incorporates location feature vectors, This is the POI Embedding updated by the Transformer.
[0055] The spatiotemporal information fusion module includes capturing spatiotemporal information based on the temporal and spatial distances between adjacent POIs in a user's historical check-in sequence, and designing a fusion function to fuse the POI embedding with the spatiotemporal information. The fusion function is as follows:
[0056]
[0057] Where T and D are the temporal distance and spatial distance, respectively, α is the temporal aggregation weight, and ω is the aggregation weight coefficient between two adjacent POIs.
[0058] The user personalized preference acquisition module includes calculating the spatial distance between adjacent POIs, the time a user spends at each POI, and the frequency (number of visits) of a user to the same POI based on the user's historical check-in information. Then, it normalizes the time, spatial distance, and frequency as spatiotemporal and frequency weights for the corresponding POIs, and calculates the user's three personalized preferences:
[0059] T,S,F = Softmax(t,s,f)
[0060]
[0061]
[0062]
[0063] Where T, S, and F are time, space, and frequency weight matrices, respectively; TUP, SUP, and FUP are time, space, and frequency personalized preferences, respectively; and P is the POI Embedding matrix.
[0064] The beneficial effects of this invention are:
[0065] 1. This invention takes into account users' social relationships more comprehensively, making the characteristics of target users more accurate.
[0066] 2. This invention captures POI information better, making POI features more accurate.
[0067] 3. This invention takes into account different user preferences, obtains user preference features more comprehensively and accurately, and improves the accuracy of prediction.
[0068] 4. This invention uses the user's historical check-in records, which can be used offline when training the model. Attached Figure Description
[0069] Figure 1 This is a flowchart illustrating the POI recommendation method based on graph attention networks and Transformers of the present invention. Detailed Implementation
[0070] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments.
[0071] Example 1
[0072] This invention provides a POI recommendation method based on graph attention networks, such as... Figure 1 As shown, it includes:
[0073] Obtain user information, including users' historical check-in information and users' social relationship information;
[0074] To obtain POI information, the intrinsic relationship features of POIs are obtained based on the POI records in the user's historical check-in records. Specifically, the POIs that the user has checked in are first extracted from the user's historical check-in records. A distance threshold k is set to construct a POI-POI graph. A graph attention network is used to obtain the attention weight of each POI, and then each POI Embedding is updated.
[0075] Based on user social relationship information, the social features of users are obtained. First, a User-User graph is constructed using the user social relationships recorded in the dataset. A graph attention network is then used to obtain the attention weight for each user, thus acquiring the user's first-order social features. Next, the target user and its n neighbors are randomly sorted, and an LSTM is used to obtain the user's second-order social features, defined by the formula:
[0076] U neighbors-1 =GAT(G user )
[0077]
[0078] Among them G user Represents a User-User graph. Represent the n neighbors of the target user;
[0079] Based on the user's historical check-in information, serialized information is obtained from the user's historical check-in sequence. First, the POIs in the user's historical check-in sequence are replaced with POI embeddings updated by a graph attention network, thereby obtaining the inherent relationship features of the POIs in the user's historical check-in sequence. Then, the Encoder module in the Transformer model is used to capture this serialized information, and its formula is defined as follows:
[0080]
[0081] in, For POI embedding that incorporates location feature vectors, This refers to the POI embedding updated by the Transformer.
[0082] Spatiotemporal information is integrated into the POI embedding to update the POI embedding in the user's historical check-in sequence. Specifically, spatiotemporal information is captured based on the temporal and spatial distances between adjacent POIs in the user's historical check-in sequence. A fusion function is designed to fuse the POI embedding with the spatiotemporal information, thereby better representing the POI embedding. The fusion function is defined as follows:
[0083]
[0084] Where T and D are the temporal distance and spatial distance, respectively, α is the temporal aggregation weight, and ω is the aggregation weight coefficient between two adjacent POIs;
[0085] Based on users' historical check-in information, user preference characteristics are obtained. Specifically, based on each user's historical check-in records, the spatial distance between adjacent Points of Interest (POIs), the time a user spends at each POI, and the frequency (number of visits) of a user to the same POI are calculated. Time, spatial distance, and frequency are normalized and used as spatiotemporal and frequency weights for the corresponding POIs. These are then used to calculate three personalized user preferences, defined by the following formula:
[0086] T,S,F=Sotmax(t,s,f)
[0087]
[0088]
[0089]
[0090] Where T, S, and F are the time, space, and frequency weight matrices, respectively; TUP, SUP, and FUP are the time, space, and frequency personalized preferences, respectively; and P is the POI Embedding matrix.
[0091] By inputting the user's historical check-in information, the inherent relationship features of POIs, the user's social features, and the user's preference features into the trained model, a list of the predicted top N POIs is obtained.
[0092] Example 2
[0093] The POI recommendation method based on graph attention networks of this invention operates as follows:
[0094] Step 1: Construct POI-POI graphs and User-User graphs based on the dataset;
[0095] Step 2: Update the embedding of each node in the constructed POI-POI graph and User-User graph using a graph attention network, and merge the information of neighboring nodes;
[0096] Step 3: Randomly sort the target user and a fixed number of its neighbor nodes, input them into the LSTM network, aggregate the second-order neighbor information of the target user, and obtain the updated embedding of the target user;
[0097] Step 4: Replace the POI in the target user's historical check-in sequence with the corresponding POI Embedding in Step 2, input it into the Transformer Encoder, capture the sequence information in the historical check-in sequence, and further update the POI Embedding;
[0098] Step 5: Combine the updated POI from Step 4 with time and geographic information to further update the POI Embedding;
[0099] Step 6: Extract the user's dwell time at each POI, the spatial distance between adjacent POIs, and the frequency of visits to the same POI from the target user's historical check-in sequence to obtain the user's spatiotemporal preferences and frequency preferences. Finally, concatenate these information to obtain the user's personalized preferences.
[0100] Step 7: Fuse the POI Embeddings from Steps 3, 5, and 6 into the model prediction layer and output the final POI prediction list.
[0101] Example 3
[0102] This embodiment provides a POI recommendation method based on graph attention networks, and the specific implementation process is as follows:
[0103] Step 1: First, analyze the Foursquare and Gowalla datasets, both of which contain five dimensions of data: user_ID, POI_ID (for check-in), latitude and longitude of the POI, and check-in timestamp. Based on the user_ID, POI_ID, and timestamp, sort the timestamps of the same user's check-in in chronological order, and extract the historical check-in sequence for each target user. Store this sequence in a map, where the key is user_ID and the value is the target user's historical check-in sequence. Examples of user historical check-in sequences are shown in Table 1.
[0104] Table 1 Examples of Historical Check-in Sequences
[0105]
[0106] Step 2: Construct the POI-POI graph and User-User graph. The specific construction process is as follows:
[0107] Step 2.1: Construct the POI-POI map. Based on the longitude and latitude of POIs in the Foursquare and Gowalla datasets, calculate the geographic distance between each pair of POIs using the semi-sine formula. If the distance is less than or equal to a distance threshold k, the two POIs are considered to be adjacent, and the corresponding position in the adjacency matrix is set to 1; otherwise, it is set to 0, thus constructing the POI-POI map.
[0108] Step 2.2: Construct the User-User Graph. The Foursquare and Gowalla datasets contain friend relationship datasets, divided into user_ID and friend_ID. Based on the friend relationship, set the corresponding position in the adjacency matrix to 1, otherwise set it to 0, thus constructing the User-User Graph.
[0109] Step 3: Use the GAT toolkit in the torch_geometric.nn package to process the above POI-POI and User-User graphs, and update each node in the graph;
[0110] Step 4: Based on the updated User-User graph from Step 3, select the target user and its n neighbors, randomly sort them, and input them into the LSTM to further update the target user nodes, thus obtaining the user's second-order social features. For example, the target user 75's neighbor nodes are 146, 1657, 4709, 5816, 7279, 8920, 12937, and 17415. Taking n=6, we select these six nodes: 146, 1657, 4709, 5816, 7279, and 8920. After random sorting using the Random() function, these nodes are input into the LSTM to update the embedding of user 75.
[0111] Step 5: In the map function of Step 1, retrieve the target user's historical check-in sequence (value) based on the target user's ID (key). Calculate the target user's personalized preferences in terms of time, location, and frequency using this historical check-in sequence.
[0112] Step 6: Similar to Step 5, first, in the map function of Step 1, retrieve the target user's historical check-in sequence (value) based on the target user's ID (key). Then, based on the updated POI-POI map from Step 3, replace the POI embeddings in the target user's historical check-in sequence sequentially. Finally, input this into the trained deep learning model to obtain the predicted list of the top N POIs.
[0113] Example 4
[0114] This invention provides a POI recommendation system based on graph attention networks, comprising:
[0115] The user information acquisition module retrieves users' historical check-in information and users' social relationship information from the database.
[0116] The POI information acquisition module is used to acquire POI information from the user's historical check-in records;
[0117] The POI intrinsic relationship acquisition module is based on a graph attention network and is used to acquire the intrinsic relationship between adjacent POIs and update the POI embedding. Specifically, it first extracts the POIs that the user has checked in, sets a distance threshold k, constructs a POI-POI graph, uses a graph attention network to obtain the attention weight of each POI, and then updates the embedding of each POI.
[0118] The user social relationship acquisition module, based on a graph attention network and an LSTM module, is used to acquire users' social features and obtain updated user embeddings. First, a User-User graph is constructed based on the user social relationships recorded in the database. The graph attention network is then used to obtain the attention weight for each user, thus acquiring the user's first-order social features. Next, the target user and its n neighbors are randomly sorted, and the second-order social features are obtained using an LSTM, defined by the following formula:
[0119] U neighbors-1 =GAT(G user )
[0120]
[0121] Among them G user Represents a User-User graph. Represent the n neighbors of the target user;
[0122] The module for obtaining serialized information from the user's historical check-in sequence uses the Encoder module in Transformer to retrieve serialized information from the user's historical check-in sequence; its formula is defined as:
[0123]
[0124] in, For POI embedding that incorporates location feature vectors, This refers to the POI embedding updated by the Transformer.
[0125] The spatiotemporal information fusion module is used to fuse spatiotemporal information from a user's historical check-in sequence to better represent the POI embedding. Specifically, it captures spatiotemporal information based on the spatial distance between adjacent POIs in the user's historical check-in sequence and the user's time spent at each POI. A fusion function is designed to combine the POI embedding with the spatiotemporal information to better represent the POI embedding. The fusion function is defined as follows:
[0126]
[0127] Where T and D are the temporal distance and spatial distance, respectively, α is the temporal aggregation weight, and ω is the aggregation weight coefficient between two adjacent POIs;
[0128] The user personalized preference acquisition module obtains the user's spatiotemporal and frequency preferences based on the user's historical check-in records, and then concatenates these preferences to form the user's personalized preferences; its formula is defined as follows:
[0129] T,S,F = Softmax(t,s,f)
[0130]
[0131]
[0132]
[0133] Where T, S, and F are the time, space, and frequency weight matrices, respectively; TUP, SUP, and FUP are the time, space, and frequency personalized preferences, respectively; and P is the POI Embedding matrix.
[0134] The model training module trains a deep learning model based on the feature information obtained from the above modules.
[0135] The POI prediction module is used to output the final list of recommended POIs.
Claims
1. A POI recommendation method based on a graph attention network, characterized in that, The method comprises the following steps: Step 1, obtaining user historical check-in information and user social relationship information; Step 2, obtaining the social characteristics of the user according to the user social relationship information obtained in step 1; Specifically, first, a User-User graph is constructed according to the user social relationship information, and the attention weight of each user is obtained by using a graph attention network, so as to obtain the first-order social characteristics of the user: wherein, represents a User-User graph; Then, the target user and its n neighbors are randomly sorted, and the second-order social characteristics of the user are obtained by using an LSTM: wherein, representing a target user, representing n neighbors of the target user; Step 3, obtaining the internal relationship characteristics of POI and updating them according to the POI records in the user historical check-in information obtained in step 1; specifically comprising the following steps: Step 3.1, extracting the POI visited by the user from the user historical check-in information, setting a distance threshold k to construct a POI-POI graph, and using a graph attention network to obtain the attention weight of each POI, and then updating the Embedding of each POI; Step 3.2, replacing the POI in the user historical check-in sequence with the POI Embedding updated by the graph attention network in step 3.1, so as to obtain the internal relationship characteristics of the POI in the user historical check-in sequence, and then capturing the serialized information by using the Encoder module in the Transformer model: wherein, POI Embedding combined with the position feature vector, POI Embedding updated by the Transformer; Step 3.3, capturing the space-time information according to the time and space distance between adjacent POIs in the user historical check-in sequence, and designing a fusion function to fuse the POI Embedding obtained in step 3.2 with the space-time information, and the fusion function is as follows: wherein T and D are time distance and space distance respectively, is a time aggregation weight, is an aggregation weight coefficient between two adjacent POIs. Step 4, obtaining the preference characteristics of the user according to the user historical check-in information obtained in step 1; specifically, according to the user historical check-in information, the space distance between adjacent POIs, the time of the user staying at each POI, and the frequency of the user visiting the same POI are calculated, that is, the number of times, and then the time, space distance and frequency are normalized as the space-time and frequency weight of the corresponding POI, and the three personalized preferences of the user are calculated: wherein, are respectively time, space and frequency weight matrices, , , are respectively time, space and frequency personalized preferences, is a POI Embedding matrix; Step 5, inputting the social characteristics of the user obtained in step 2, the internal relationship characteristics of the POI obtained in step 3, and the preference characteristics of the user obtained in step 4 into the trained deep learning model to obtain the predicted top N POI list.
2. The POI recommendation system based on the graph attention network, characterized in that, It comprises: a user information acquisition module for acquiring user historical check-in information and user social relationship information; a user social relationship acquisition module for obtaining the social characteristics of the user and obtaining the updated Embedding of the user; a POI information acquisition module for acquiring POI records in the user historical check-in information; a POI internal relationship acquisition module for obtaining the internal relationship between adjacent POIs and updating the Embedding of the POI; a user historical check-in sequence information acquisition module for acquiring the serialized information in the user historical check-in sequence; and a space-time information fusion module for fusing the space-time information in the user historical check-in sequence to better express the Embedding of the POI; The user individual preference acquisition module is configured to acquire user spatio-temporal and frequency preferences and splice the user spatio-temporal and frequency preferences into user individual preferences. The model training module is configured to train the deep learning model. The POI prediction module is configured to output a POI recommendation list. The user social relationship acquisition module includes the following steps: first, constructing a User-User graph according to user social relationship information, and acquiring the attention weight of each user by using a graph attention network, thereby acquiring the first-order social features of the user. wherein, represents a User-User graph; The target user and the n neighbors are randomly sorted, and the second-order social features of the user are acquired by using an LSTM. wherein, representing a target user, representing n neighbors of the target user; The POI internal relationship acquisition module includes the following steps: extracting the POIs visited by the user from the user historical check-in information, setting a distance threshold k to construct a POI-POI graph, acquiring the attention weight of each POI by using a graph attention network, and updating the POI Embedding of each POI. The user historical check-in sequence information acquisition module includes the following steps: replacing the POIs in the user historical check-in sequence with the POI Embedding updated by using the graph attention network, thereby acquiring the internal relationship features of the POIs in the user historical check-in sequence, and then capturing the sequence information by using the Encoder module in the Transformer model. wherein, is a POI Embedding combined with a position feature vector, is a POI Embedding updated by a Transformer; The spatio-temporal information fusion module includes the following steps: capturing the spatio-temporal information according to the time and space distances between adjacent POIs in the user historical check-in sequence, and designing a fusion function to fuse the POI Embedding and the spatio-temporal information, the fusion function being as follows: wherein T and D are time distance and space distance respectively, is a time aggregation weight, is an aggregation weight coefficient between two adjacent POIs. The user individual preference acquisition module includes the following steps: calculating the space distance between adjacent POIs, the time of the user staying at each POI, and the frequency of the user visiting the same POI according to the user historical check-in information, then normalizing the time, the space distance, and the frequency, respectively, as the spatio-temporal and frequency weights of the corresponding POI, and calculating the three individual preferences of the user. wherein, are respectively time, space and frequency weight matrices, , , are respectively time, space and frequency personalized preferences, is a POI Embedding matrix.
Citation Information
Patent Citations
POI recommendation method and system based on mixed graph neural network
CN115270007A
Continuous interest point recommendation method based on social spatio-temporal information and user preference
CN115422441A