A POI prediction method based on spatio-temporal perception and combined with local and global preferences

By combining local and global characteristics, the problem of uncaptured user dynamic interests and geographical factors in the prior art is solved, and more accurate POI prediction is achieved, especially in the dependence and dynamic preference mining of space-time regions.

CN115510333BActive Publication Date: 2025-07-08CHONGQING UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211176462.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-26
Publication Date
2025-07-08
Estimated Expiration
2042-09-26

AI Technical Summary

Technical Problem

The prior art fails to effectively capture the dynamic interests and geographical factors of users over time in POI prediction, resulting in the prediction results being untargeted in the temporal and spatial dimensions, reducing the prediction accuracy.

Method used

The POI prediction method based on space-time perception is adopted, and the local feature module is combined with the global feature module, and the local feature module is used to learn the dependence between the POIs in the space-time area, and the user's dynamic preferences are captured through the global feature module, and feature fusion is combined with local and global features to improve prediction accuracy.

Benefits of technology

It effectively improves the accuracy of POI prediction. By dividing personalized space-time areas based on geographical distance and time intervals, users' dynamic preferences and dependencies in space-time areas are explored, and the prediction effect of the next POI is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115510333B_ABST
    Figure CN115510333B_ABST
Patent Text Reader

Abstract

The present invention relates to a POI prediction method based on spatio-temporal perception and combined with local and global preferences, comprising the following steps: S1: Selecting a publicly available check-in POIs dataset as a training set, which includes user historical POI trajectory sequences; S2: Constructing a POI prediction model LGSA, which includes a local feature module, a global feature module, and a feature fusion module; S3: Using the local feature module and the global feature module to calculate Loc u and Glo u of the user historical POI trajectory sequences; S4: Setting an initial weight coefficient α, and using the feature fusion module to combine Loc u and Glo u to obtain a total preference feature C u ; S5: Using the total preference feature C u to predict the next point of interest of the user. Using the model of the present invention can further improve the accuracy of POI prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of POI prediction, and particularly to a POI prediction method based on spatio-temporal awareness and combined with local and global preferences. Background Art

[0002] With the increasing popularity of personalized service platforms, location-based social networks (LBSNs) such as Foursquare and Brightkite have become a favorite social platform for the public. Users leave a large number of check-ins at POIs (Points of Interest) on the social platform. These data provide data support for the research of user personalized services. Predicting the next location has always been a long-term problem in location-based personalized services. Predicting people's travel behaviors and destinations through historical trajectories can provide more personalized and intelligent location services for individual users. For example, by mining the user's historical POI trajectories and obtaining the user's preferences, the next location can be recommended for the user.

[0003] In the POI prediction problem, the user's check-ins at POIs are affected by multiple factors such as time, geography, POI category, and long-term preferences. Among them, geographical distance affects the range of locations where users continuously check in because users tend to choose multi-functional areas with short geographical distances between POIs. In the time dimension, users check in at POIs with different functions at different time points. For example, the POIs checked in at 12:00 noon are generally restaurants, and the POI categories checked in from 14:00 to 17:00 in the afternoon are leisure places such as cafes and cinemas. In addition, the dynamic preferences of users over time are also crucial. The trajectory sequence can reflect the dynamic preferences of users over time and the dependence between the check-in locations.

[0004] Considering the above factors, in recent years, most studies have used recurrent neural networks (RNNs) or their variants to capture the long-term and short-term preferences of users, or used spatio-temporal attention networks to aggregate all the visited locations in the user's historical POI trajectories. To capture the long-term and short-term preferences of users, Ma et al. proposed a hierarchical gated network combined with Bayesian personalized ranking. Subsequently, Ma et al. further proposed a memory-enhanced graph neural network on the original problem to capture the long-term and short-term preferences of users. However, both of these methods rely on shallow methods and cannot effectively capture the dynamic interests of users over time, and ignore the geographical factors in the trajectory sequence. Such methods result in the predicted locations not being targeted in the time and space dimensions, thereby reducing the prediction effect. While ST-RNN and STAN both consider the spatio-temporal characteristics of user check-ins at POIs, they ignore the user's trajectory sequence and personalized spatio-temporal regions. Predicting locations in this way will reduce the strong correlation between locations in the same spatio-temporal region. Summary of the Invention

[0005] In view of the above problems existing in the prior art, the technical problem to be solved by the present invention is: how to improve the prediction accuracy of POIs.

[0006] To solve the above technical problem, the present invention adopts the following technical solution: a POI prediction method based on spatio-temporal perception and combined with local and global preferences, comprising the following steps:

[0007] S100: Select the publicly checked-in POIs dataset as the training set O, and the training set O includes the user's historical POI trajectory sequences, and the historical POI trajectory sequence of each user is expressed as indicating the point of interest where the user is located at time t s ;

[0008] The user's historical POI trajectories are arranged in chronological order, and the user's historical POI trajectory sequence includes user tags, time tags, location tags, and the longitude and latitude corresponding to the location tags;

[0009] S200: Construct a POI prediction model LGSA, and LGSA includes a local feature module, a global feature module, and a feature fusion module;

[0010] S300: Randomly select a user's historical POI trajectory sequence from the training set O, and calculate the local feature vector representation and the global feature vector representation of the user's historical POI trajectory sequence:

[0011] S310: Use the local feature module to calculate the local feature vector representation Loc of the user in the spatio-temporal region by taking the user's historical POI trajectory sequence as the input u , and the expression is as follows:

[0012]

[0013] where, T represents matrix transpose, avg(·) represents the average function, ranh(·) represents the activation function, At l represents the attention score matrix, represents the subsequence feature of the fine-grained subsequence;

[0014] S320: Use the global feature module to calculate the global feature vector representation Glo of the user in units of weeks by taking the user's historical POI trajectory sequence as the input u , and the expression is as follows:

[0015] Glo u = LN(A h + Dropout(PFFN(A h ))) ; (2)

[0016] where, Ah The output after the feature passes through multi-head attention is denoted as, LN(·) represents layer normalization in the neural network, Dropout(·) represents the method adopted to prevent the model from overfitting, and PFFN(·) represents the positive feed-forward network;

[0017] S400: Set the initial weight coefficient α, and use the feature fusion module to combine Loc u and Glo u to obtain the overall preference feature C of this user by fusing local features and global features through weighted summation, u The specific expression is as follows:

[0018] C u = αLoc u +(1 - α)Clo u ; (3)

[0019] where α represents the weight coefficient, and α ∈ [0, 1];

[0020] S500: Use the overall preference feature C u to calculate the predicted POI of this user. The specific steps are as follows:

[0021] S510: Calculate the predicted POI representation vector P u of this user. The expression is as follows:

[0022]

[0023] where, represents the location representation feature in the trajectory sequence, d represents the feature dimension, t represents time, Co represents the feature relationship between locations in the user's spatio-temporal region, and the calculation expression of Co is as follows:

[0024]

[0025] where, represents the subsequence representation vector of the spatio-temporal region, and W r is a learnable parameter;

[0026] S520: Map P u to the location label of the POI through index mapping to obtain the predicted POI of this user; the index mapping is that one POI location label corresponds to one POI representation vector, and the two are in a one-to-one correspondence;

[0027] S600: Use the predicted POI representation vector of this user to calculate the objective function K of the LGSA model. The specific expression is as follows:

[0028] K = argmin∑ (u,pos,neg)∈O -log(σ(Pu,pos -P u,neg )); (6)

[0029] Among them, P u,pos represents the distance between the real POI and the predicted POI representation vector, and P u,neg represents the distance between the POI not in the current user's trajectory sequence and the predicted POI representation vector, u represents the user label, pos represents the real POI label, neg represents the POI label not in the current user's trajectory sequence, and σ represents the sigmoid function;

[0030] S700: Use the objective function K as the loss function to train the LGSA model, and at the same time use the gradient descent method to update the LGSA model parameters in reverse;

[0031] S800: Traverse all the user's historical POI trajectory sequences in the training set, repeat steps S300 - S700 to train the model, preset the maximum number of training iterations, and stop training when the training reaches the maximum number of iterations to obtain the trained LGSA model;

[0032] S900: Use the historical POI trajectory sequence of the user to be predicted as the input of the trained LGSA, and the output is the prediction result of the next POI of the user to be predicted.

[0033] Preferably, the specific steps for calculating the local feature vector representation Loc u of each user in the spatio - temporal region are as follows:

[0034] S311: Randomly select a user's historical POI trajectory sequence, and perform time - interval processing on this user's historical POI trajectory sequence. The specific expression is as follows:

[0035]

[0036] Among them, represents the time interval between the user's visit to location i and location j, t i represents the timestamp at location i, and t j represents the timestamp at location j;

[0037] Perform geographical - distance processing on this user's historical POI trajectory sequence. The specific expression is as follows:

[0038]

[0039] Among them, represents the geographical distance between the visit to location i and location j, r represents the radius, lon i and lat i represent the GPS of location i iThe longitude and latitude, lon j and lat j represent the GPS j of location j. Haversine(·) represents the geographical distance function;

[0040] S312: Divide the user's historical POI trajectory sequence according to the time interval and geographical distance to obtain the spatio-temporal region set Reg u , and the specific expression is as follows:

[0041] Reg u = {reg1, reg2, …, reg x}; (9)

[0042] where reg x represents the x-th spatio-temporal region, and x represents the number of spatio-temporal regions;

[0043] S313: Use the sliding window w to divide each spatio-temporal region in the spatio-temporal region set into fine-grained subsequences, and the specific expression is as follows:

[0044]

[0045] where w represents the size of the sliding window;

[0046] S314: Calculate the subsequence features of the fine-grained subsequences The calculation expression is as follows:

[0047]

[0048] where W1 represents the learnable parameter, M a ∈R w×d represents the adaptive adjacency matrix, d represents the feature dimension, tanh represents the activation function, and the subsequence embedding within the region is represented as

[0049] S315: Calculate the attention score matrix, and the calculation expression is as follows:

[0050]

[0051] where At l represents the attention score matrix, and W2, W3, b1, and b2 all represent learnable parameters, and Softmax represents the activation function;

[0052] S316: Use At l and to calculate and obtain the local feature vector representation Loc u of the user in the spatio-temporal region;

[0053] S317: Traverse all user historical POI trajectory sequences in the training set, and calculate the local feature vector representation of each user in the spatio-temporal region.

[0054] This method can effectively mine the features of the locations themselves and the information of the associated locations around them in the spatio-temporal region subsequence, and obtain the interest preferences of users within a specific local spatio-temporal region range.

[0055] Preferably, in S320, the calculation of the global feature vector representation Glo of the user in the spatio-temporal region u is as follows:

[0056] S321: Randomly select a user historical POI trajectory sequence, fuse the time information in the user historical POI trajectory sequence, and the calculation expression is as follows:

[0057]

[0058] where represents the user historical POI trajectory sequence after fusing the time information, W4 represents the learnable parameter, represents the concatenation vector of the trajectory sequence and the special time period;

[0059] S322: Calculate the non-intrusive self-attention of The calculation expression is as follows:

[0060]

[0061] where N represents N layers of multi-head attention network layers, Attention(·) represents the attention function, Q, K, and V are learnable matrices mapped from and S u respectively, K T T represents the transpose matrix of K, and σ represents the learnable parameter;

[0062] S323: Calculate N layers of multi-head attention, and the calculation expression is as follows:

[0063]

[0064]

[0065] where is the y-th layer of the multi-head attention network layer, A h is the output of the multi-head attention layer, GWLU represents the Gaussian error linear unit, and W5, W6, b5, and b6 represent the learnable parameters;

[0066] S324: Perform layer normalization and dropout function processing on the outputs of each sub - layer to obtain the global feature vector representation Glo of the user in the spatio - temporal region. u ;

[0067] S325: Traverse all user historical POI trajectory sequences in the training set, and calculate the global feature vector representation of each user in the spatio - temporal region.

[0068] This method focuses on the user dynamic sequence, that is, the global features can effectively capture the dynamic preferences and long - term semantics of the user's behavior over time, and mine the relevant locations in the trajectory sequence.

[0069] Preferably, the specific steps for time information fusion in S321 are as follows:

[0070] S321 - 1: The historical trajectory sequence of each user is The special time patterns in the user historical POI trajectory sequence, where, represents the location representation vector in the trajectory sequence, t i represents the representation vector of the special time period, u represents the user, and week represents the special time period in weeks;

[0071] S321 - 2: According to the time unit conversion, convert the POI check - in time into a special time period in weeks to obtain the embedding matrix of the special time period

[0072] Calculate the embedding matrix E(S u ) of the trajectory sequence according to the word2vec word embedding method;

[0073] S321 - 3: Concatenate and E(S u ) in the feature dimension to obtain the concatenated matrix The specific expression is as follows:

[0074]

[0075] where, con(·) represents the concatenation function;

[0076] S321 - 4: Use the activation function to process to obtain the user historical POI trajectory sequence after completing time information fusion

[0077] Local features capture the dependencies between POIs of users in spatio-temporal regions, and global features can obtain users' dynamic preferences for specific time periods. Therefore, by combining local features and global features, it is possible to more effectively capture users' behavior preferences at the spatio-temporal level on the basis of considering the trajectory sequence.

[0078] Compared with the prior art, the present invention has at least the following advantages:

[0079] 1. The present invention discloses a POI prediction method based on spatio-temporal awareness and combining local and global preferences for predicting the next POI. According to the geographical distance and time interval, the trajectory sequence of each user is divided into personalized spatio-temporal regions, and the dependencies between POIs in the check-in regions of users are learned from a local view. In addition, time information fusion is used to mine users' dynamic preferences changing over time with a fine-grained time of one week, because the weekly change cycle feature can well reflect the specific activities of users' historical trajectories every week; a non-invasive way is used to fuse the trajectory sequence of users and the time period of the sequence, and the dynamic preferences of users for this time period are mined from a global view. Finally, the local features and global features are fused to obtain the total preference feature, and finally the next POI prediction point of the user is obtained using the total preference feature.

[0080] 2. The present invention proposes an LGSA model to learn users' preferences from local (i.e., personalized spatio-temporal regions) and global (i.e., trajectory sequences with time periods) views based on users' historical POI trajectory sequences.

[0081] 3. In order to effectively learn the local dependencies in spatio-temporal regions, the present invention proposes personalized spatio-temporal awareness regions. According to the geographical distance and time interval in the trajectory sequence, personalized spatio-temporal regions are divided for each user, and the dependencies between the check-in POIs of users in the spatio-temporal regions are learned from a local view. This way can reduce the correlation of POIs in different spatio-temporal regions in the trajectory sequence, thereby improving the prediction result.

[0082] 4. In order to fully integrate the trajectory sequence and the personalized time period, the present invention uses a non-invasive way to fuse the trajectory sequence of users and the time period of the sequence, and mines the dynamic preferences of users and the POI temporal sequence of the trajectory sequence over the time period from a global view. This way neither covers the trajectory information nor can well extract the relationship between the trajectory sequence and the weekly change cycle. BRIEF DESCRIPTION OF THE DRAWINGS

[0083] Figure 1 It is a structural framework diagram of LGSA including local features and global features in the present invention.

[0084] Figure 2 It is a schematic diagram of dividing spatio-temporal regions using time intervals and geographical distances in the present invention.

[0085] Figure 3 This is the performance comparison on the NYC dataset in the experiments of the present invention.

[0086] Figure 4 This is the performance comparison on the TKY dataset in the experiments of the present invention.

[0087] Figure 5 This is the performance comparison on the Brightkite dataset in the experiments of the present invention.

[0088] Figure 6 This is the batch processing parameter experiment in the experiments of the present invention.

[0089] Figure 7 This is the spatio-temporal threshold parameter experiment in the experiments of the present invention. Detailed implementation manners

[0090] The present invention will be further described in detail below.

[0091] The present invention discloses a method for predicting the next POI based on spatio-temporal perception and combining local and global preferences. A local preference module is proposed according to the dependencies between POIs in the personalized spatio-temporal region; then, the global preference is modeled to mine the dynamic preferences of users over a specific time period; and modeling the preference aggregation can effectively fuse local features and global features, thereby completing the POI prediction.

[0092] See Figure 1 - Figure 2 , a method for predicting POI based on spatio-temporal perception and combining local and global preferences, comprising the following steps:

[0093] S100: Select the publicly available check-in POIs dataset as the training set O, and the training set O includes the user historical POI trajectory sequences, and the historical POI trajectory sequence of each user is represented as represents the point of interest where the user is located at time t s ;

[0094] The user historical POI trajectories are arranged in chronological order, and the user historical POI trajectory sequence includes user tags, time tags, location tags, and the longitude and latitude corresponding to the location tags;

[0095] S200: Construct a POI prediction model LGSA, and LGSA includes a local feature module, a global feature module, and a feature fusion module;

[0096] S300: Randomly select a user historical POI trajectory sequence from the training set O, and calculate the local feature vector representation and the global feature vector representation of the user historical POI trajectory sequence:

[0097] S310: Use the user's historical POI trajectory sequence as input, and use the local feature module to calculate the local feature vector representation Loc of the user in the spatio-temporal region, as follows: u , the expression is as follows:

[0098]

[0099] Among them, T represents matrix transpose, avg(·) represents the average function, tanh(·) represents the activation function, At l represents the attention score matrix, represents the subsequence feature of the fine-grained subsequence;

[0100] The specific steps for calculating the local feature vector representation Loc of each user in the spatio-temporal region in S310 are as follows: u are as follows:

[0101] S311: Randomly select a user's historical POI trajectory sequence, and perform time interval processing on the user's historical POI trajectory sequence. The specific expression is as follows:

[0102]

[0103] Among them, represents the time interval between the user's visit to location i and location j, t i represents the timestamp at location i, t j represents the timestamp at location j;

[0104] Perform geographical distance processing on the user's historical POI trajectory sequence. The specific expression is as follows:

[0105]

[0106] Among them, represents the geographical distance between the visit to location i and location j, r represents the radius, lon i and lat i represent the longitude and latitude of the GPS of location i i of, lon j and lat j represent the longitude and latitude of the GPS of location j j of, and Haversine(·) represents the geographical distance function;

[0107] S312: Divide the user's historical POI trajectory sequence according to the time interval and geographical distance to obtain the spatio-temporal region set Reg u , the specific expression is as follows:

[0108] Reg u ={reg1, reg2,..., regx} ; (9)

[0109] where reg x represents the x-th spatio-temporal region, and x represents the number of spatio-temporal regions;

[0110] The time interval between locations in the trajectory sequence is in minutes. The time interval threshold θ t and the geographical distance threshold θ g are both used to divide spatio-temporal regions; specifically, calculate the time interval and geographical distance of the trajectory sequence, and set their different median values as the thresholds for dividing spatio-temporal regions; therefore, each sequence obtains a different number of spatio-temporal regions. In the present invention, spatio-temporal regions are considered local features.

[0111] S313: Use a sliding window w to divide each spatio-temporal region in the spatio-temporal region set into fine-grained subsequences. The sliding window is an existing known experimental strategy, and the specific expression is as follows:

[0112]

[0113] where w represents the size of the sliding window; this experimental strategy can help the model pay more attention to the connection between adjacent check-in locations within the spatio-temporal region and ignore irrelevant locations with little influence; for each user, there is a corresponding spatio-temporal region set, and for each spatio-temporal region of the user, use the sliding window to generate a subsequence set, and the number of subsequence sets is determined by the size of the sliding window.

[0114] S314: Calculate the subsequence features of the fine-grained subsequences The calculation expression is as follows:

[0115]

[0116] where W1 represents learnable parameters, M a ∈R w×d represents an adaptive adjacency matrix, d represents the feature dimension, tanh represents an activation function, and this activation function is used to make the value range of the matrix from -1 to 1; the subsequence embedding within the region is represented as Since the subsequence is not an inherent graph for GNN modeling, it is necessary to construct a graph to capture the connections between positions, add edges between positions in the subsequence, calculate the number of edges of the item pairs extracted from all users and establish an adaptive adjacency matrix, and normalize the adjacency matrix according to the number of edges. This adaptive adjacency matrix can automatically learn the dependency relationship between subsequence locations in the region.

[0117] S315: Calculate 's attention score matrix, and the calculation expression is as follows:

[0118]

[0119] Among them, At l represents the attention score matrix, W2, W3, b1, and b2 all represent learnable parameters, and Softmax represents the activation function; here, two layers of GNN are used to aggregate information, which is to well mine the features of subsequences in the spatio-temporal region and the information of surrounding locations; the attention score matrix can assign attention weights to each location and extract the locations that the user pays more attention to in the local region.

[0120] S316: Use At l and to calculate the local feature vector representation Loc u of this user on the spatio-temporal region;

[0121] S317: Traverse all user historical POI trajectory sequences in the training set and calculate the local feature vector representation of each user on the spatio-temporal region.

[0122] S320: Use the user historical POI trajectory sequence as the input and use the global feature module to calculate the global feature vector representation Glo u of this user on a weekly time unit, and the expression is as follows:

[0123] Glo u = LN(A h + Dropout(PFFN(A h ))) ; (2)

[0124] Among them, A h represents the output after the feature passes through multi-head attention, LN(·) represents layer normalization in the neural network, Dropout(·) represents a method used to prevent the model from overfitting, and PFFN(·) represents the positive forward feed network;

[0125] The specific steps for calculating the global feature vector representation Glo u of the user on the spatio-temporal region in S320 are as follows:

[0126] S321: Randomly select a user historical POI trajectory sequence and fuse the time information in the user historical POI trajectory sequence. The calculation expression is as follows:

[0127]

[0128] Among them, represents the user historical POI trajectory sequence after completing time information fusion, W4 represents a learnable parameter, represents the concatenated vector of the trajectory sequence and the special time period;

[0129] The specific steps for fusing time information in S321 are as follows:

[0130] S321-1: The historical trajectory sequence of each user is The special time patterns in the user's historical POI trajectory sequence where represents the location representation vector in the trajectory sequence, t i represents the representation vector of the special time period, u represents the user, and week represents the special time period in weeks;

[0131] S321-2: According to the time unit conversion, convert the POI check-in time into a special time period in weeks to obtain the embedding matrix of the special time period

[0132] Calculate the embedding matrix E(S u ) of the trajectory sequence according to the word2vec word embedding method. The word2vec word embedding method is a prior art;

[0133] S321-3: Concatenate and E(S u ) in the feature dimension to obtain the concatenated matrix The specific expression is as follows:

[0134]

[0135] where con(·) represents the concatenation function;

[0136] S321-4: Use the activation function to process to obtain the user's historical POI trajectory sequence after completing time information fusion

[0137] S322: Calculate the non-intrusive self-attention of The calculation expression is as follows: The calculation expression is as follows:

[0138]

[0139] where N represents N layers of multi-head attention network layers, Attention(·) represents the attention function, Q, K, and V are learnable matrices mapped from and S u respectively, K T represents the transpose matrix of K, and σ represents the learnable parameter;

[0140] S323: Calculate N layers of multi-head attention. The calculation expression is as follows:

[0141]

[0142]

[0143] Among them, is the y-th layer of the multi-head attention network layer, A h is the output of the multi-head attention layer, GELU represents the Gaussian error linear unit, and W5, W6, b5, and b6 represent learnable parameters;

[0144] S324: Perform layer normalization processing and dropout function processing on the outputs of each sub-layer to obtain the global feature vector representation Glo of this user in the spatio-temporal region u ;

[0145] S325: Traverse all user historical POI trajectory sequences in the training set, and calculate the global feature vector representation of each user in the spatio-temporal region.

[0146] S400: Set the initial weight coefficient α, and use the feature fusion module to combine Loc u and Glo u That is, aggregate the interests of the user, and fuse the local features and the global features through weighted summation to obtain the total preference feature C of this user u , and the specific expression is as follows:

[0147] C u = αLoc u +(1 - α)Glo u ; (3)

[0148] Among them, α represents the weight coefficient, α ∈ [0, 1]; Combining local and global features can more effectively capture the user's behavior preferences at the spatio-temporal level, rather than just considering the trajectory sequence; Combining these two feature representations can well complete the location prediction work, and the combination here is obtained by fusing local features and global features through weighted summation. The value of α is sequentially selected from {0.0, 0.1, 0.2,..., 0.8, 0.9, 1.0} for parameter experiment to calculate the C u value, and the α value corresponding to the maximum C u value is used as the optimal α value.

[0149] S500: Use the total preference feature C u to calculate the predicted POI of this user, and the specific steps are as follows:

[0150] S510: Calculate the predicted POI representation vector P u of this user, and the expression is as follows:

[0151]

[0152] in, represents the location representation feature in the trajectory sequence, d represents the feature dimension, t represents time, and Co represents the feature relationship between locations in the user's spatiotemporal area. The calculation expression of Co is as follows:

[0153]

[0154] in, The subsequence representing the spatiotemporal region is represented by a vector, W r is a learnable parameter;

[0155] S520: Map P through index mapping u Mapping to the location tag of the POI, obtaining the predicted POI of the user; the index mapping is that one POI location tag corresponds to one POI representation vector, and the two are in a one-to-one correspondence;

[0156] S600: Calculate the objective function K of the LGSA model using the predicted POI representation vector of the user. The specific expression is as follows:

[0157] K=argmin∑ (u,pos,neg)∈O -log(σ(P u,pos -P u,neg )); (6)

[0158] Among them, P u,pos represents the distance between the real POI and the predicted POI representation vector, P u,neg represents the distance between the POI in the trajectory sequence of the non-current user and the predicted POI representation vector, u represents the user label, pos represents the real POI label, neg represents the POI label in the trajectory sequence of the non-current user, σ represents the sigmoid function, and the objective function is to shorten the distance between the predicted POI vector and the real value vector and to increase the distance from the negative sampling vector. The negative sampling vector is the POI value of the non-current user, that is, the POI that the current user has not checked in. The objective function argmin uses the Bayesian personalized sorting objective function;

[0159] S700: train the LGSA model using the objective function K as the loss function, and simultaneously reversely update the LGSA model parameters using the gradient descent method;

[0160] S800: traverse all user historical POI trajectory sequences in the training set, repeat steps S300-S700 to train the model, preset the maximum number of training iterations, stop training when the maximum number of iterations is reached, and obtain a trained LGSA model;

[0161] S900: Use the historical POI trajectory sequence of the user to be predicted as the input of the trained LGSA, and the output is the prediction result of the next POI of the user to be predicted.

[0162] Experimental verification

[0163] 1. Dataset

[0164] The experimental evaluation of the present invention is carried out on the following two public LBSN datasets, which belong to the known and publicly available datasets with relatively high credibility. The specific situation of the datasets is shown in Table 1.

[0165] Foursquare dataset: Foursquare is a location-based social networking site where users share their locations by checking in. This dataset includes long-term (about 10 months) check-in data of New York City and Tokyo collected from Foursquare from April 12, 2012 to February 16, 2013. In the present invention, users who visited less than 10 POIs and POIs with less than 10 visitors were removed. After preprocessing, the dataset of New York City contains 134,691 check-ins of 1,078 users and 4,513 POIs, while the dataset of Tokyo contains 401,857 check-ins of 2,266 users and 6,952 POIs.

[0166] Brightkite dataset: Brightkite was once a location-based social networking service provider where users shared their locations by checking in. This dataset contains check-in records generated on Brightkite from April 2008 to October 2010. In this experiment, the first 10,000 users were selected, and users who visited less than 10 POIs or more than 1,000 POIs, as well as POIs with less than 10 visitors, were removed. After preprocessing, the Brightkite dataset contains 884,373 check-ins of 5,153 users and 19,034 POIs.

[0167] In this experiment, the first 80% of the sequence of each user is used as the training set, and the subsequent 20% is used as the test set. The historical trajectories of users are sorted in chronological order. More detailed information about the datasets is shown in Table 1.

[0168] Table 1 Dataset statistical information

[0169] Dataset NYC TKY Brightkite User 1,078 2,266 5,153 POIs 4,513 6,952 19,034 Number of Check - ins at POIs 134,691 401,857 884,373 Average Number of Check - ins per User 124.95 177.34 171.62 Average Number of Times a POI is Checked In 29.85 57.80 46.46 Sparsity 97.235% 97.451% 99.098%

[0170] 2. Baseline

[0171] In this experiment, we mainly focus on the features of the trajectory sequence and the spatio-temporal influence between POIs to predict the next POI. Therefore, the proposed LGSA of the present invention is compared with the following baseline models.

[0172] TOP: This method records the popularity of POIs in the dataset and recommends the most popular POIs to users.

[0173] ST-RNN: This method constructs specific time transition matrices at different time intervals and specific distance transition matrices at different geographical distances for the prediction of the next location.

[0174] HGN: This method combines a hierarchical gating network with Bayesian personalized ranking and uses the long-term and short-term interests of users for sequential recommendation.

[0175] MA-GNN: This method uses a memory-augmented graph neural network to capture the long-term and short-term interests of users for sequential recommendation.

[0176] STAN: This method uses a spatio-temporal attention network to aggregate all relevant visits from the user's trajectory and recalls the most reasonable candidates from the weighted representations for location recommendation.

[0177] 3. Evaluation Metrics

[0178] According to the previous settings, this experiment uses four evaluation metrics for the next POI prediction task. These evaluation metrics are Precision@10, Recall@10, Normalized Discounted Cumulative Gain (NDCG@10), and Mean Average Precision (MAP@10), where 10 is the number of POIs in the ranking list; when the correct POI is among the top 10 POIs, the scores of Precision@10 and Recall@10 are high. NDCG@10 is used as an evaluation metric for the ranking result to evaluate the accuracy of the ranking, and MAP scores the quality of the entire ranking set. The larger the values of these four evaluation metrics, the better the performance.

[0179] 4. Experimental Details

[0180] For the spatio-temporal threshold, this experiment conducts experiments at the lower quartile, upper quartile, median, and mean of the three-digit numbers respectively, and takes the optimal result, the median, as the threshold. When both the geographical distance and time interval exceed the median, a region is divided. The sliding window size in the local region is selected from {4, 6, 8, 10} respectively for experiments, and when L = 6, the results are optimal on all three datasets.

[0181] In the LGSA model, the model is trained using the Adam optimizer with a learning rate of 0.001, and the regularization parameter is set to 0.001; the hyperparameters are adjusted through grid search on the validation set; the embedding size is set to 100. The batch size for NYC and Brightkite is set to 2048, and the batch size for TKY is set to 4096. For the spatio-temporal threshold, the average of the time interval and the spatial interval, 25%, 50%, and 75% are used as the thresholds for the experiment, and the best 50% of the results are taken as the threshold; when the geographical distance and the time interval exceed the corresponding median in the user's historical POI trajectory sequence, the spatio-temporal region is divided. The sliding window size w in the local features is selected from {4, 6, 8, 10} for the experiment. When w is 6, the results on the three datasets are the best, the length of the trajectory sequence is set to 100, and the local weight coefficient α is selected from {0.2, 0.4, 0.6, 0.8, 1.0} for the experiment. When α is 0.4, the results are optimal.

[0182] 5. Results

[0183] The results are as Figure 3 shown in Figures 4 and 5. In the baseline, the top performs the worst on the four evaluation metrics, indicating that simply obtaining the popularity of POIs and making predictions is not feasible; both HGN and MA-GNN focus on the long-term and short-term preferences of users, and the effects are significantly better than TOP, but the spatio-temporal features are not considered, so the effects are lower than LGSP; both ST-RNN and STAN mine the spatio-temporal features of the trajectory to obtain the context features of the trajectory, but ignore the sequence features and periodicity of the trajectory, so the results are lower than LGSP.

[0184] The LGSP model is significantly better than the baseline in terms of the NDCG@10 metric, indicating that the model has a good sorting effect on the prediction results; secondly, in terms of the recall@10 metric, indicating that the model can well recall the set of items to be predicted; however, in terms of the precision@10 metric, the advantage of the LGSP model is not great, only slightly better than the baseline. On the TKY dataset, LGSP is significantly better than the baseline in terms of the pre@10, NDCG@10, and MAP evaluation metrics, indicating that the LGSP model has improved in prediction accuracy and sorting effect, but the improvement in recall is not much; the effect on the Brightkite dataset has not been greatly improved, only slightly better than the baseline.

[0185] 6. Parameter Experiments

[0186] To study the impact of different settings on key hyperparameters, this experiment evaluated the LGSP model by changing the batch size of relevant item sets and the size of spatio-temporal thresholds respectively:

[0187] First, change the batch size. Double it from 256 to 4096, as Figure 6 shown. It shows that on the New York City and Brightkite datasets, higher performance was obtained when the batch size was 2048, while on the TKY dataset, the batch size was 4096. As the batch size value increases, the performance of the model gradually increases because when the batch value is too small, the training data is difficult to converge, resulting in underfitting.

[0188] Second, regarding the spatio-temporal threshold. In this experiment, thresholds for the mean, lower quartile, median, and upper quartile were experimented with, Figure 7 and the results shown indicate that on the three datasets, higher performance was obtained when the spatio-temporal threshold was the median; this shows that the spatio-temporal threshold based on the median can well divide the personalized spatio-temporal regions of users; the mean ignores the distribution of time intervals and geographical distances, and the presence of outliers easily enlarges or shrinks the results; neither the lower quartile nor the upper quartile can accurately grasp the spatio-temporal regions of user activities.

[0189] 7. Ablation Experiment

[0190] An ablation study of the LGSA model was conducted on the NYC, TKY, and Brightkite datasets, including four aspects: only considering local features (LF), only considering global features (GF), combining local and global features (LF+GF), and the fusion time period of local and global features (LF+GF+time). The experimental results are shown in Table 2.

[0191] Table 2 Ablation Experiment Results on the NYC, TKY, and Brightkite Datasets

[0192]

[0193] From the experimental results, it can be seen that when there are only global features, the performance on the TKY dataset is the worst, which indicates that the spatio-temporal regions of users in the TKY dataset are a very important feature, and users on this platform tend to move within the spatio-temporal regions; from the three datasets, it can be seen that predicting the next POI requires not only considering the sequentiality of the user's historical POI trajectories from a global perspective, i.e., the dynamic preferences over time, but also considering the user's personalized spatio-temporal regions locally and mining the dependencies between POIs; from the experimental results, it can be seen that the time period feature does not improve the performance of the model much because the time period is considered from a global perspective and has a small proportion in the model structure.

[0194] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the purpose and scope of the technical solutions of the present invention, and they should all be covered by the scope of the claims of the present invention.

Claims

1. A POI prediction method based on spatio-temporal perception and combining local and global preferences, characterized in that: It includes the following steps: S100: Select the publicly checked-in POIs dataset as the training set O, and the training set O includes the user's historical POI trajectory sequences. The historical POI trajectory sequence of each user is expressed as indicating the POI where the user is located at time t s moment. The user's historical POI trajectories are arranged in chronological order. The user's historical POI trajectory sequence includes user tags, time tags, location tags, and the corresponding longitude and latitude of the location tags; S200: Construct a POI prediction model LGSA, which includes a local feature module, a global feature module, and a feature fusion module; S300: Randomly select a user's historical POI trajectory sequence from the training set O, and calculate the local feature vector representation and the global feature vector representation of this user's historical POI trajectory sequence: S310: Use the user's historical POI trajectory sequence as input, and use the local feature module to calculate the local feature vector representation Loc of the user in the spatio-temporal region. u , and the expression is as follows: where \(T\) represents matrix transpose, \(avg(\cdot)\) represents the average function, \(tanh(\cdot)\) represents the activation function, \(A_t\) l represents the attention score matrix, represents the subsequence feature of the fine-grained subsequence; S320: Use the user's historical POI trajectory sequence as input, and use the global feature module to calculate the global feature vector representation Glo of the user on a weekly time unit. u , and the expression is as follows: Glo u = LN(A h + Dorpout(PFFN(A h ))); (2) Among them, A h represents the output after the feature passes through the multi-head attention, LN(·) represents layer normalization in the neural network, Dropout(·) represents the method adopted to prevent the model from overfitting, and PFFN(·) represents the positive feed-forward network; S400: Set the initial weight coefficient α, and use the feature fusion module to combine Loc u and Glo u to obtain the overall preference feature C of the user by fusing the local feature and the global feature through weighted summation. The specific expression is as follows: u ​ C u = αLoc u + (1 - α)Glo u ; (3) where α represents a weight coefficient, and α ∈ [0, 1]; S500: Utilize the total preference feature C u Calculate the predicted POI of this user, and the specific steps are as follows: S510: Calculate the predicted POI representation vector P of the user u , and the expression is as follows: Among them, represents the location representation feature in the trajectory sequence, d represents the feature dimension, t represents time, Co represents the feature relationship between locations in the user's spatio-temporal region, and the calculation expression of Co is as follows: Among them, represents the subsequence representation vector of the spatio-temporal region, and W r is a learnable parameter; S520: Map P to the location tag of the POI through index mapping to obtain the predicted POI of the user; the index mapping is that one POI location tag corresponds to one POI representation vector, and the two are in a one-to-one correspondence; u Map to the location tag of the POI to obtain the predicted POI of the user; the index mapping is that one POI location tag corresponds to one POI representation vector, and the two are in a one-to-one correspondence; S600: Use the predicted POI representation vector of this user to calculate the objective function K of the LGSA model. The specific expression is as follows: K = argmin ∑ (u,pos,neg)∈O -log(σ(P u,pos -P u,neg )) ; (6) Among them, P u,pos represents the distance between the real POI and the predicted POI representation vector, and P u,neg represents the distance between the POI in the non-current user trajectory sequence and the predicted POI representation vector, u represents the user label, pos represents the real POI label, neg represents the POI label in the non-current user trajectory sequence, and σ represents the sigmoid function; S700: Use the objective function K as the loss function to train the LGSA model, and at the same time use the gradient descent method to update the LGSA model parameters backward; S800: Traverse all the user's historical POI trajectory sequences in the training set, repeat steps S300 - S700 to train the model, preset the maximum number of training iterations, and stop training when the training reaches the maximum number of iterations to obtain the trained LGSA model; S900: Take the user's historical POI trajectory sequence to be predicted as the input of the trained LGSA, and the output is the prediction result of the next POI of this user to be predicted.

2. The POI prediction method based on spatio-temporal perception and combined with local and global preferences according to claim 1, characterized in that: In S310, the local feature vector representation Loc of each user in the spatio-temporal region is calculated u The specific steps are as follows: S311: Randomly select a user's historical POI trajectory sequence, and perform time interval processing on this user's historical POI trajectory sequence. The specific expression is as follows: Among them, represents the time interval between the user's access to location i and location j, t i represents the timestamp at location i, t j represents the timestamp at location j; Perform geographical distance processing on this user's historical POI trajectory sequence. The specific expression is as follows: Among them, represents the geographical distance between access point i and access point j, r represents the radius, lon i and lat i represent the longitude and latitude of the GPS i of access point i, lon j and lat j represent the longitude and latitude of the GPS j of access point j, and Haversine(·) represents the geographical distance function; S312: Divide the user's historical POI trajectory sequence according to the time interval and geographical distance to obtain a spatio-temporal region set Reg u , and the specific expression is as follows: Reg u = {reg1, reg2, …, reg x}; (9) Among them, reg x represents the x-th spatio-temporal region, where x represents the number of spatio-temporal regions; S313: Use a sliding window w to divide each spatio-temporal region in the spatio-temporal region set into fine-grained subsequences. The specific expression is as follows: where w represents the size of the sliding window; S314: Calculate the subsequence features of the fine-grained subsequence The calculation expression is as follows: Among them, W1 represents the learnable parameter, M a ∈R w×d represents the adaptive adjacency matrix, d represents the feature dimension, tanh represents the activation function, and the subsequence embedding within the region is represented as S315: Calculate 's attention score matrix, and the calculation expression is as follows: Among them, At l represents the attention score matrix, W2, W3, b1, and b2 all represent learnable parameters, and Softmax represents the activation function; S316: Utilize At l and to calculate the local feature vector representation Loc of this user in the spatio-temporal region u ; S317: Traverse all the user's historical POI trajectory sequences in the training set, and calculate the local feature vector representation of each user on the spatio-temporal region.

3. A POI prediction method based on spatio-temporal perception and combining local and global preferences as described in claim 2, characterized in that: The specific steps for calculating the global feature vector representation Glo of the user in the spatio-temporal region in S320 are as follows: u as follows: S321: Randomly select a user's historical POI trajectory sequence, and fuse the time information in this user's historical POI trajectory sequence. The calculation expression is as follows: Among them, represents the user's historical POI trajectory sequence after the completion of time information fusion, and W4 represents learnable parameters, represents the concatenation vector of the trajectory sequence and the special time period; S322: Calculate non-invasive self-attention The calculation expression is as follows: Among them, N represents N layers of multi-head attention network layers, Attention(·) represents the attention function, and Q, K, and V are learnable matrices mapped from and S u respectively, K T represents the transpose matrix of K, and σ represents a learnable parameter; S323: Calculate N - layer multi-head attention. The calculation expression is as follows: Among them, is the y-th layer of the multi-head attention network layer, A h is the output of the multi-head attention layer, GELU represents the Gaussian error linear unit, and W5, W6, b5, and b6 represent learnable parameters; S324: Perform layer normalization processing and dropout function processing on the outputs of each sub-layer to obtain the global feature vector representation Glo of the user in the spatio-temporal region u ; S325: Traverse all the user's historical POI trajectory sequences in the training set, and calculate the global feature vector representation of each user on the spatio-temporal region.

4. A POI prediction method based on spatio-temporal perception and combining local and global preferences as described in claim 3, characterized in that: The specific steps of fusing time information in S321 are as follows: S321-1: The historical trajectory sequence of each user is The special time patterns in the user's historical POI trajectory sequence, where represents the location representation vector in the trajectory sequence, t i represents the representation vector of the special time period, u represents the user, and week represents the special time period in weeks; S321-2: According to the time unit conversion, convert the POI check-in time into a special time period in weeks, and obtain the embedding matrix of the special time period Calculate the embedding matrix E(S u ) according to the word2vec word embedding method; S321-3: Concatenate and E(S u ) along the feature dimension to obtain the concatenated matrix The specific expression is as follows: where con(·) represents a concatenation function; S321-4: Use the activation function to process to obtain the user's historical POI trajectory sequence after the completion time information fusion

Citation Information

Patent Citations

  • User track position prediction method based on space-time embedding Self-Attention

    CN111400620A

  • Relation mining-oriented interest point recommendation method based on joint neural network

    CN113268669A