Position prediction system and method based on graph-enhanced time-space model
The interest point recommendation system based on the graph-enhanced time-space model solves the problem of insufficient capture of temporal dependencies and complex geographical influences in the existing technology. Through the combination of the interest point semantic graph and the LSTM attention mechanism, the interest points are improved. Recommendation accuracy and model convergence.
Patent Information
- Application Number
- CN202210626657.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-04
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2042-06-04
AI Technical Summary
Existing next point of interest recommendation systems are difficult to effectively capture the temporal dependencies in user visit history and the complex geographical influences between points of interest, resulting in models that are difficult to converge and lack reasonable integration of temporal information and spatial information.
Using a graph-based enhanced time-space model, we extract high-order spatial dependencies between interest points by constructing interest point semantic graphs and graph embedding technology, and combine LSTM and attention mechanisms to adaptively fuse the user's temporal dependencies and spatial dependencies. , generate user preference scores for points of interest.
The accuracy of recommendation results is significantly improved. By capturing the aggregation module of spatial dependence and space-time dependence, the recommendation performance of the model is improved, especially in terms of recall rate and discount cumulative benefit.
Smart Images

Figure CN114925294B
Abstract
Description
Technical Field
[0001] The present invention relates to a technology in the field of neural network applications, specifically a future point of interest recommendation system based on a graph enhanced time-space model. Background Art
[0002] Existing next POI recommendation systems often only use the geographical distance between adjacent POIs as the input of the model and are unable to model the complex geographical influences between POIs.
[0003] After searching the prior art, it was found that the Chinese patent document number CN114021011A was published on 20220208, disclosing a next point of interest recommendation method based on the self-attention mechanism. First, the sequence information, spatiotemporal information and context-related dynamic social relations are integrated and modeled; secondly, two parallel channels (long / short-term channels) are designed to model the long / short-term preferences of users and their friends, and the self-attention mechanism is used to capture the long-distance dependency between any two historical check-ins of the user; finally, the user's preference score for the point of interest at the next moment is predicted. However, it is difficult for the prior art to reasonably capture the time dependency of the user's visit history. Specifically, when modeling long-term and short-term preferences, the prior art only uses the vanilla attention mechanism to model the mutual influence between the representations of the points of interest in the user sequence, and there is no design for modeling the time information of the access sequence, and the influence of the time dependency in the sequence on the user's interest is not considered. The technology lacks the modeling of the important geographical influence of the transfer relationship of the point of interest. As a physical location that exists in fact, the point of interest has a strong contextual relationship. The technology lacks this part of the design. The modeling method of the distance relationship of the technology needs to be optimized. The L2L graph constructed by this technology directly uses geographic distance as the edge weight, without reasonable regularization and numerical normalization. In the specific implementation, the problem of large numerical differences causing the model to be difficult to converge may occur; this technology lacks reasonable integration of temporal information and spatial information. This technology directly uses geographic information as the original input for sequence modeling. Since the distribution of geographic information and temporal information is generally different, this structure serializes two different types of information together and it is difficult to capture them reasonably. Summary of the invention
[0004] In view of the above-mentioned deficiencies in the prior art, the present invention proposes a point of interest recommendation system based on a graph-enhanced time-space model, which extracts information from the semantic graph of point of interest by utilizing graph embedding technology to obtain high-order spatial dependencies between points of interest, and adaptively integrates the user's temporal dependency and the spatial dependency between points of interest by utilizing LSTM and attention mechanism.
[0005] The present invention is achieved through the following technical solutions:
[0006] The present invention relates to a method for recommending points of interest based on a graph-enhanced time-space model, comprising:
[0007] Step 1) Data preprocessing: Unify the format of access records and perform simple cleaning on the records. Generate a historical access sequence for each user in chronological order.
[0008] Step 2) Constructing a semantic graph of interest points: According to the coordinate information of all interest points and all user-interest point interaction records, a semantic graph based on geographic distance and a semantic graph based on transfer relationship are constructed to respectively save the distance relationship and transfer relationship between interest points.
[0009] Step 3) construct and train a graph-enhanced time-space model, which includes: a spatial dependency module, a time dependency module and a space-time dependency aggregation module, wherein: the spatial dependency module first uses an embedding operation to obtain an embedding vector of the distance relationship and the transfer relationship of the interest point, and then performs a graph embedding operation on the two interest point semantic graphs constructed in step 2) to obtain the spatial dependency representation of the corresponding interest point; the time dependency module first uses an embedding operation to obtain the embedding representation of the interest point itself, and then uses LSTM to model the user's historical access sequence, and uses the last output of the sequence as the user's time dependency information; the space-time dependency aggregation module aggregates the above-obtained interest point spatial dependency information and the user's time dependency information according to the attention mechanism, first uses the time dependency information as the query of the attention mechanism, and aggregates the spatial dependency representation of the interest point in the sequence as the key and value of the attention mechanism, and adds the result obtained after the aggregation with the spatial dependency of the interest point to obtain the user-specific spatial dependency, and then adds the time dependency and the user-specific spatial dependency to obtain the user's preference score for the interest point.
[0010] The spatial dependency module uses a Gaussian kernel function to model distance: Where: dist(l i , l j ) represents the spatial distance between two interest points, represents the Gaussian kernel function, and the transfer relationship refers to the direct transfer relationship between interest points, that is, in all user sequences, interest point l j In l i The number of subsequent visits.
[0011] The threshold Δd of the Gaussian kernel function is preferably 1 km.
[0012] The embedding operation is: l =Ev l , where e l is the learned embedding representation, E is the learnable embedding matrix, and vl is the unique heat representation of the point of interest.
[0013] The time-dependent module is calculated through the LSTM process: T 1t =σ(W x1 x t +σ(Δt t W t1 )+b 1 ), T 2t =σ(W x2 x t +σ(Δt t W t2 )+b 2 ),i t =tanh(W i x t +W i h t-1 +b i ), o t =tanh(W o x t +W o h t-1 +b o ), Where: W cx , W x1 , W x2 , W i , W o is the trainable parameter matrix, b c , b 1 , b 2 , b i , b o is a trainable bias term. is the dot product, tanh is the tanh function, x t is the vector representation of the interest point at the previous moment.
[0014] The attention mechanism is specifically: Where W 1 ,W 2 ,W 3 is the parameter matrix, Q, K, V are the query, key and value in the mechanism, and d is the dimension size of the vector.
[0015] Step 4) Generate recommendation results: In the recommendation stage, the user's dynamic preferences at the next time point generated by the model are used to calculate the user's visit probability to the point of interest. Points of interest with high visit probability are selected and recommended to the user.
[0016] The probability is calculated as: Among them, exp represents the exponential function with e as the base, r u,i represents the preference score of user u for point of interest i in step 3).
[0017] Technical Effects
[0018] The present invention takes the time difference between adjacent access records as the input of LSTM, constructs a semantic graph based on the transfer relationship and explicitly models the time dependency of the access history. On two evaluation datasets, the spatial dependency captured by the semantic graph of the point of interest and the space-time dependency aggregation module both improve the recommendation results of the model to a certain extent. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 Flowchart of the recommendation system based on graph-enhanced time-space model;
[0020] Figure 2 It is a semantic graph of interest points based on distance relations;
[0021] Figure 3 It is a semantic graph of interest points based on transfer relations;
[0022] Figure 4 Schematic diagram of the graph-enhanced time-space model structure. DETAILED DESCRIPTION
[0023] like Figure 1 As shown, this embodiment relates to a method for recommending points of interest based on a graph-enhanced time-space model, including:
[0024] Step 1) Data preprocessing: Users’ visits to POIs will generate corresponding records, i.e.<u,l,time> , where u∈U represents the user and l∈L represents the point of interest. Each point of interest has its specific geographic information<l,lon,lat> , which means that the longitude and latitude coordinates of the point of interest l are lon and lat respectively. First, these interaction records need to be cleaned to remove some possible noise, such as deleting points of interest that have been visited less than 5 times in the entire data set, and deleting users with less than 5 visit records. For the records generated by each user, sorting them according to the timestamp can form the visit sequence H of user u u ={ <l 1 , t 1 >, <l 2 , t 2 >..., <l n , t n >}.
[0025] Step 2) Constructing a semantic graph of interest points, including:
[0026] 2.1) Construct distance map: Figure 2 As shown, the distance graph is a weighted undirected graph G D =(V, E D , A D ), used to capture the distance relationship between interest points. In the figure, V is the set of all interest points, E D ∈V x V is the set of edges in the graph. When two points of interest l i and l j When the distance between them is less than the set threshold Δd, there is an edge between the two nodes, that is, e ij ∈E D . A D ∈R NxN is the weight matrix, which stores the weight of each edge. Where: dist(l i , l j ) represents the spatial distance between two interest points. represents the Gaussian kernel function. In this embodiment, the threshold Δd is set to 1 km.
[0027] 2.2) Constructing the transfer graph: Figure 3 As shown, the transition graph is a weighted directed graph G T =(V, E T , A T ), used to capture the transition relationship between interest points, where: V is the set of all interest points, E T ∈VxV is the set of edges in the graph. For the same user’s access sequence, if the interest point l j Directly appear in l i After that, there is a transfer relationship between the two nodes, that is, there is an edge between the corresponding nodes. T ∈R NxN is the weight matrix, storing the weight freq(l i , l j ), that is, in all user sequences, the interest point l j In l i The number of subsequent visits.
[0028] Step 3) Build and train the graph-enhanced time-space recommendation model, including:
[0029] 3.1) Spatial dependency modeling, that is, modeling the spatial dependency between interest points from a global perspective: Based on the two interest point semantic graphs constructed in the previous step, two spatial dependencies are captured: distance-based spatial dependency and transfer-based spatial dependency. First, an embedding operation is used to obtain each interest point l i The embedding vector of Vector based on propagation capability Vector based on receptive capacity in: is a trainable embedding matrix, k is the dimension of the embedding vector, and v i Yes i The three embedding vectors are then optimized through graph embedding technology to represent the spatial dependencies of interest points.
[0030] The graph embedding technology mentioned above refers to:
[0031] ① Distance graph G D Any two points of interest in i and l j The conditional probability that there is an edge (i.e. direct connection) between them Where: exp(·) represents an exponential function with e as the base. Two points of interest l i and l j The empirical probability that there is an edge (i.e., direct connection) between them in Represents the weight matrix A D The (i, j)-bit element of the d is embedded according to the conditional probability and empirical probability. i To reduce the computational complexity, this embodiment omits some constant terms and adopts a negative sampling strategy to obtain the optimization function Where: σ is the sigmoid function, NEG(i) is the i In this embodiment, the number of negative samples is set to 5.
[0032] ②For the transfer graph G T , calculate the propagation capability and acceptance capability for each interest point, where the propagation capability represents the ability of the interest point to transfer users to other interest points, and the acceptance capability represents the ability of the interest point to accept users to transfer in. Similarly, this embodiment calculates the transfer graph G T Any two points of interest in i and l j The conditional probability of the existence of an edge And the empirical probability in: Represents the (i, j)th element in the weight matrix; optimization function of transmission capacity and reception capacity By optimizing the above two functions, three optimized embedding representations d, g, and h are obtained to represent the spatial dependency relationship between interest points.
[0033] 3.2) Temporal dependency modeling, that is, modeling the temporal dependency of user access sequences: First, use the embedding operation to obtain a low-dimensional vector representation x for each point of interest i , and convert the points of interest in the user’s historical visit sequence into corresponding embedding representations. Where: x i represents the embedding representation of the interest point itself, represents the embedding matrix, v i The unique hot representation of the point of interest is used; LSTM is used to model the time dependency, and LSTM satisfies: T 1t =σ(W x1 x t +σ(Δt t W t1 )+b 1 ), T 2t =σ(W x2 x t +σ(Δt t W t2 )+b 2 ),i t =tanh(W i x t +W i h t-1 +b i ), o t =tanh(W o x t +W o h t-1 +b o ), Where: W cx , W x1 , W x2 , W i , W o is the trainable parameter matrix, b c , b 1 , b 2 , b i , b o is a trainable bias term. is the dot product, tanh is the tanh function, x t is the vector representation of the point of interest at the previous moment. The present invention takes the last output of LSTM as the time dependency, i.e. h n =LSTM(x 1 , …, x n ).
[0034] 3.3) Time-space dependency aggregation: For each point of interest in the user's historical sequence, the attention mechanism is used to aggregate their spatial dependencies as follows: Where: W d1 , W g1 , W d2 , W g2 , W d3 , W g3 is a trainable parameter matrix, softmax represents the softmax function, and the user visits the point of interest l j Geographical influences d , I t By l j The geographic dependencies of all points of interest in the historical visit sequence are added together, specifically: Where: g i ,g i ,g i is the distance-based, propagation-based, and receptivity-based vector representation of the interest point. u | indicates the sequence length.
[0035] Step 4) Generate recommendation results: Based on the temporal dependency and aggregated spatial dependency obtained above, this embodiment can calculate the user u’s recommendation for the point of interest l j Preference Preference score r u , j The larger the value, the more likely the user will visit l at the next time point. j The greater the probability, the more we should j Recommended to users.
[0036] This embodiment verifies the recommendation effect of the system on the Gowalla and Foursquare datasets. Both datasets are collected from the real world and are widely used in experimental verification related to the next point of interest recommendation.
[0037] The parameters in the experiment were set as follows: the embedding vector dimension of the item was set to 64, the length of the user's access sequence was set to 20, and when the length was less than 20, the left end of the sequence was padded with 0 until the sequence length became 20. The mini-batch gradient descent optimization method was used and the batch size was set to 128. During training, the Adam optimizer was used and the learning rate was set to 0.001.
[0038] Evaluation method: In order to evaluate the performance of the recommendation system disclosed by this method, it is compared with a variety of existing next point of interest recommendation technologies in experimental verification. When evaluating the recommendation effect, the recall ratio (abbreviated as Recall) and the normalized discounted cumulative gain (abbreviated as NDCG) are used as evaluation indicators. This embodiment specifically compares the performance of the disclosed system with the existing technology in Recall@5, Recall@10, NDCG@5, and NDCG@10. On the Foursquare dataset, the Recall@5, Recall@10, NDCG@5, and NDCG@10 values of the disclosed system are 0.2713, 0.3416, 0.2019, and 0.2246. On the Gowalla dataset, the Recall@5, Recall@10, NDCG@5, and NDCG@10 values of the disclosed system are 0.2146, 0.2791, 0.1541, and 0.1749.
[0039] Compared with other existing technologies, the performance indicators of this system are improved in the following aspects: for the Recall@5 indicator, it is improved by 9.21% and 13.96% on the two tasks; for the HR@10 indicator, it is improved by 5.72% and 11.73% on the two tasks; for the NDCG@5 indicator, it is improved by 10.2% and 13.22% on the two tasks. For the NDCG@10 indicator, it is improved by 8.29% and 6.51% on the two tasks.
[0040] The present invention also uses ablation experiments to verify the technical effects of the spatial dependency captured by the semantic graph and the spatial-temporal dependency aggregation module. The present invention first removes the spatial dependency captured by the semantic graph on the basis of the complete model. For the Recall@10 indicator, the ablated model decreases by 18.38% and 19.27% on the two tasks. Secondly, the present invention removes the spatial-temporal dependency aggregation module on the basis of the complete model. For the Recall@10 indicator, the ablated model decreases by 1.14% and 1.12% on the two tasks.
[0041] In summary, the present invention utilizes high-order complex geographical influences between points of interest to provide additional effective basis for the next point of interest recommendation. The present invention uses the geographical distance information and transfer information of the points of interest to respectively construct two semantic graphs of points of interest: the semantic graph based on geographical distance contains the distance information between points of interest. Generally speaking, users are more inclined to visit points of interest that are close to the current location. The semantic graph based on transfer information contains the transfer relationship between points of interest. For example, after visiting a bar, users are less likely to go to their workplace. The present invention utilizes a spatial dependency modeling module to extract relevant high-order geographical influences, and combines the user's time dependency to generate recommendation results. The present invention is an end-to-end architecture that does not require manual definition or extraction of a particularly large number of features; the architecture also has good scalability.
[0042] The above-mentioned specific implementation can be partially adjusted in different ways by those skilled in the art without departing from the principle and purpose of the present invention. The protection scope of the present invention shall be based on the claims and shall not be limited by the above-mentioned specific implementation. Each implementation scheme within its scope shall be subject to the constraints of the present invention.
Claims
1. A method for recommending points of interest based on graph-enhanced temporal-spatial model. It is characterized in that include: Step 1) Data preprocessing: unify the format of access records and perform simple cleaning on the records; generate a historical access sequence for each user in chronological order; Step 2) Constructing a semantic graph of interest points: constructing a semantic graph based on geographic distance and a semantic graph based on transfer relationship based on the coordinate information of all interest points and all user-interest point interaction records, respectively used to save the distance relationship and transfer relationship between interest points, including: 2.1) Constructing the distance graph: The capped distance graph is a weighted undirected graph G D =(V, E D , A D ), used to capture the distance relationship between interest points. In the figure, V is the set of all interest points, E D ∈VxV is the set of edges in the graph. When two points of interest l i and l j When the distance between them is less than the set threshold Δd, there is an edge between the two nodes, that is, e ij ∈E D ; A D ∈R NxN is the weight matrix, which stores the weight of each edge. Where: dist(l i , l j ) represents the spatial distance between two interest points; represents the Gaussian kernel function; 2.2) Construct a transition graph: The transition graph is a weighted directed graph G T =(V, E T , A T ), used to capture the transition relationship between interest points, where: V is the set of all interest points, E T ∈VxV is the set of edges in the graph. For the same user’s access sequence, if the interest point l j Directly appear in l i After that, there is a transfer relationship between the two nodes, that is, there is an edge between the corresponding nodes; A T ∈R NxN is the weight matrix, storing the weight freq(l i , l j ), that is, in all user sequences, the interest point l j In l i the number of subsequent visits; Step 3) construct and train a graph-enhanced time-space model, which includes: a spatial dependency module, a time dependency module and a space-time dependency aggregation module, wherein: the spatial dependency module first uses an embedding operation to obtain an embedding vector of the distance relationship and the transfer relationship of the interest point, and then performs a graph embedding operation on the two interest point semantic graphs constructed in step 2) to obtain the spatial dependency representation of the corresponding interest point; the time dependency module first uses an embedding operation to obtain the embedding representation of the interest point itself, and then uses LSTM to model the user's historical access sequence, and uses the last output of the sequence as the user's time dependency information; the space-time dependency aggregation module aggregates the above-obtained interest point spatial dependency information and the user's time dependency information according to the attention mechanism, first uses the time dependency information as the query of the attention mechanism, and aggregates the spatial dependency representation of the interest point in the sequence as the key and value of the attention mechanism, and adds the result obtained after the aggregation with the spatial dependency of the interest point to obtain the user-specific spatial dependency, and then adds the time dependency and the user-specific spatial dependency to obtain the user's preference score for the interest point, specifically including: 3.1) Spatial dependency modeling, that is, modeling the spatial dependency between interest points from a global perspective: Based on the two interest point semantic graphs constructed in the previous step, two spatial dependencies are captured: distance-based spatial dependency and transfer-based spatial dependency. First, an embedding operation is used to obtain each interest point l i The embedding vector of Vector based on propagation capability Vector based on receptive capacity in: is a trainable embedding matrix, k is the dimension of the embedding vector, and v i Yes i The three embedding vectors are then optimized through graph embedding technology to represent the spatial dependency of interest points. 3.2) Temporal dependency modeling, that is, modeling the temporal dependency of user access sequences: First, use the embedding operation to obtain a low-dimensional vector representation x for each point of interest i , and convert the points of interest in the user's historical visit sequence into corresponding embedding representations; Where: x i represents the embedding representation of the interest point itself, represents the embedding matrix, v i The unique hot representation of the point of interest is used; LSTM is used to model the time dependency, and LSTM satisfies: T 1t =σ(W x1 x t +σ(Δt t W t1 )+b 1 ), T 2t =σ(W x2 x t +σ(Δt t W t2 )+b 2 ),i t =tanh(W i x t +W i h t-1 +b i ), o t =tanh(W o x t +W o h t-1 +b o ), Where: W cx , W x1 , W x2 , W i , W o is the trainable parameter matrix, b c , b 1 , b 2 , b i , b o is a trainable bias term; ⊙ is the dot product, tanh is the tanh function, x t is the vector representation of the point of interest at the previous moment; take the last output of LSTM as the time dependency, that is, h n =LSTM(x 1 , …, x n ); 3.3) Time-space dependency aggregation: For each point of interest in the user's historical sequence, the attention mechanism is used to aggregate their spatial dependencies as follows: Where: W d1 , W g1 , W d2 , W g2 , W d3 , W g3 is a trainable parameter matrix, softmax represents the softmax function, and the user visits the point of interest l j Geographical influences d , I t By l j The geographic dependencies of all points of interest in the historical visit sequence are added together, specifically: Where: d i ,g i ,h i is the distance-based, propagation-based, and receptivity-based vector representation of the interest point. u | indicates the length of the sequence; Step 4) Generate recommendation results: In the recommendation stage, the user's dynamic preferences at the next time point generated by the model are used to calculate the user's visit probability to the point of interest; and points of interest with high visit probability are selected and recommended to the user.
2. The method for recommending points of interest based on a graph-enhanced time-space model according to claim 1, Its characteristics are: The Gaussian kernel function has a threshold Δd of 1 km.
3. The method for recommending points of interest based on a graph-enhanced time-space model according to claim 1, Its characteristics are: The embedding operation is: l =Ev l , where e l is the learned embedding representation, E is the learnable embedding matrix, and v l is the unique heat representation of the point of interest.
4. The method for recommending points of interest based on a graph-enhanced time-space model according to claim 1, Its characteristics are: The attention mechanism is specifically: Where W 1 ,W 2 ,W 3 is the parameter matrix, Q, K, V are the query, key and value in the mechanism, and d is the dimension size of the vector.
5. The method for recommending points of interest based on a graph-enhanced time-space model according to claim 1, Its characteristics are: The probability is calculated as: Among them, exp represents the exponential function with e as the base, r u,i represents the preference score of user u for point of interest i in step 3).
6. The method for recommending points of interest based on a graph-enhanced time-space model according to claim 1, Its characteristics are: The graph embedding technology mentioned above refers to: ① Distance graph G D Any two points of interest in i and l j There is an edge between them, that is, the conditional probability of direct connection Among them: exp(·) represents the exponential function with e as the base; two points of interest l i and l j There is an edge between them, that is, the empirical probability of direct connection in Represents the weight matrix A D The (i, j)-bit element of the d is embedded according to the conditional probability and empirical probability. i To reduce the computational complexity, the optimization function Where: σ is the sigmoid function, NEG(i) is the i A negative sampling set; ②For the transfer graph G T , calculate the propagation capacity and acceptance capacity for each interest point, where: the propagation capacity represents the ability of the interest point to transfer users to other interest points, and the acceptance capacity represents the ability of the interest point to accept users to transfer in; calculate the transfer graph G T Any two points of interest in i and l j The conditional probability of the existence of an edge And the empirical probability in: Represents the (i, j)th element in the weight matrix; optimization function of transmission capacity and reception capacity By optimizing the above two functions, three optimized embedding representations d, g, and h are obtained to represent the spatial dependency relationship between interest points.
