CN115510333A - POI prediction method based on space-time perception and combined with local and global preferences - Google Patents

POI prediction method based on space-time perception and combined with local and global preferences Download PDF

Info

Publication number
CN115510333A
CN115510333A CN202211176462.XA CN202211176462A CN115510333A CN 115510333 A CN115510333 A CN 115510333A CN 202211176462 A CN202211176462 A CN 202211176462A CN 115510333 A CN115510333 A CN 115510333A
Authority
CN
China
Prior art keywords
poi
user
representing
time
historical
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211176462.XA
Other languages
Chinese (zh)
Inventor
曾骏
赵翊竹
朱泓宇
高旻
周魏
文俊浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing University
Original Assignee
Chongqing University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chongqing University filed Critical Chongqing University
Priority to CN202211176462.XA priority Critical patent/CN115510333A/en
Publication of CN115510333A publication Critical patent/CN115510333A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9536Search customisation based on social or collaborative filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9537Spatial or temporal dependent retrieval, e.g. spatiotemporal queries

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention relates to a POI prediction method based on space-time perception and combined with local and global preferences, which comprises the following steps: s1: selecting a public signed POI data set as a training set, wherein the training set comprises a historical POI track sequence of a user; s2: constructing a POI prediction model LGSA, wherein the LGSA comprises a local feature module, a global feature module and a feature fusion module; s3: computing Loc of user historical POI trajectory sequence using local feature module and global feature module u And Glo u (ii) a S4: setting an initial weight coefficient alpha, and fusing Loc by using a feature fusion module u And Glo u Combining to obtain the total preference characteristic C u (ii) a S5: using global preference feature C u And predicting to obtain the next interest point of the user. The model of the invention can further improve the accuracy of POI prediction.

Description

POI prediction method based on space-time perception and combined with local and global preferences
Technical Field
The invention relates to the field of POI prediction, in particular to a POI prediction method based on space-time perception and combined with local and global preferences.
Background
With the increasing growth of personalized service platforms, location-based social networks (LBSSs) such as Foursquare and BrightKite become popular social platforms, a large number of POI (point of interest) points are left in the social platforms by users, the data provides data support for the research of the personalized services of the users, the next location prediction is a long-term problem of the personalized services based on the location, and the more personalized and intelligent location services can be provided for the individual users by predicting the travel behaviors and destinations of the people through historical tracks. For example, the next place may be recommended for the user by mining the user's historical POI tracks and obtaining user preferences.
In the POI prediction problem, the point of interest sign-in of a user is influenced by various factors such as time, geography, point of interest category, long-term preference and the like; wherein the geographic distance affects the range over which the user will continuously check in to the place, as users are more inclined to select multi-functional areas with close geographic distance between points of interest; in the time dimension, users can sign in points of interest with different functions according to time points, for example, the point of interest signed in at 12 am is a restaurant generally, and the categories of the points of interest signed in at 14 to 00 pm are leisure places such as coffee houses, movie theaters and the like. In addition to this, the dynamic preferences of the user over time are also of importance, and the sequence of trajectories can reflect the dependency between the dynamic preferences of the user over time and the sign-on location.
In view of the above, most recent studies have used Recurrent Neural Networks (RNNs) or variants thereof to capture user long-term and short-term preferences, or spatio-temporal attention networks to aggregate all visited places in a user's historical POI track, ma et al propose a hierarchical gated network in combination with bayesian personalized ranking in order to capture user long-term and short-term preferences; then, ma et al further propose a memory-enhanced graph-based neural network to capture the user's long-term and short-term preferences in the original question. However, both methods rely on shallow methods, which cannot effectively capture the dynamic interest of the user over time, and ignore the geographic factors in the trajectory sequence, which results in the predicted location being non-targeted in the temporal and spatial dimensions, thereby reducing the prediction effect; however, the ST-RNN and the STAN consider the spatiotemporal characteristics of POI signed by the user, but neglect the track sequence and the personalized spatiotemporal region of the user, and the method for predicting the location reduces the strong relevance of the location in the same spatiotemporal region.
Disclosure of Invention
Aiming at the problems in the prior art, the technical problems to be solved by the invention are as follows: how to improve the accuracy of the prediction of POIs.
In order to solve the technical problem, the invention adopts the following technical scheme: a POI prediction method based on space-time perception and combining local preference and global preference comprises the following steps:
s100: selecting a public sign-on POIs data set as a training set O, wherein the training set O comprises user historical POI track sequences, and the historical POI track sequence of each user is represented as
Figure BDA0003864635210000021
Figure BDA0003864635210000022
Indicates that the user is at t s The interest point of the moment;
the historical POI tracks of the user are arranged according to a time sequence, and the historical POI track sequence of the user comprises a user tag, a time tag, a place tag and longitude and latitude corresponding to the place tag;
s200: constructing a POI prediction model LGSA, wherein the LGSA comprises a local feature module, a global feature module and a feature fusion module;
s300: randomly selecting a user history POI track sequence from the training set O, and calculating the local feature vector representation and the global feature vector representation of the user history POI track sequence:
s310: taking the historical POI track sequence of the user as input, and calculating the local feature vector representation Loc of the user on a space-time area by using a local feature module u The expression is as follows:
Figure BDA0003864635210000023
where T represents the matrix transpose, avg (-) represents the averaging function, ranh (-) represents the activation function, at l A matrix of the attention scores is represented,
Figure BDA0003864635210000024
sub-sequence features representing fine-grained sub-sequences;
s320: taking the historical POI track sequence of the user as input, calculating the global feature vector representation Glo of the user in week time unit by using a global feature module u The expression is as follows:
Glo u =LN(A h +Dropout(PFFN(A h ))); (2)
wherein, A h Represents the output of the features after multi-head attention, LN (-) represents layer normalization in a neural network, dropout (-) represents a method adopted to prevent overfitting of a model, and PFFN (-) represents a forward feed-forward network;
s400: setting an initial weight coefficient alpha, and fusing the Loc by using a feature fusion module u And Glo u Combining, fusing the local features and the global features through weighted summation to obtain the total preference feature C of the user u The specific expression is as follows:
C u =αLoc u +(1-α)Clo u ; (3)
wherein, alpha represents a weight coefficient, and is within the range of [0,1];
s500: using global preference feature C u Calculating the predicted POI of the user, which comprises the following specific steps:
s510: calculating a predicted POI representation vector P for the user u The expression is as follows:
Figure BDA0003864635210000025
wherein,
Figure BDA0003864635210000026
representing the position in the track sequence to represent the characteristic, d represents the characteristic dimension, t represents time, co represents the characteristic relation among the positions in the user time space region, and the calculation expression of Co is as follows:
Figure BDA0003864635210000031
wherein,
Figure BDA0003864635210000032
the sub-sequences representing the spatio-temporal regions represent vectors, W r Are learnable parameters;
s520: mapping P by index u Mapping to a place label of the POI to obtain a predicted POI of the user; the index mapping is that a POI place label corresponds to a POI representation vector, and the POI place label and the POI representation vector are in one-to-one correspondence;
s600: calculating an objective function K of the LGSA model by using the predicted POI expression vector of the user, wherein the specific expression is as follows:
K=argmin∑ (u,pos,neg)∈O -log(σ(P u,pos -P u,neg )); (6)
wherein, P u,pos Distance, P, representing real POI from predicted POI representation vector u,neg Representing the distance between the POI in the non-current user track sequence and the predicted POI representation vector, u representing a user tag, pos representing a real POI tag, neg representing the POI tag in the non-current user track sequence, and sigma representing a sigmoid function;
s700: training the LGSA model by using the target function K as a loss function, and meanwhile, reversely updating LGSA model parameters by using a gradient descent method;
s800: traversing all historical POI track sequences of the users in the training set, repeating the steps S300-S700 to train the model, presetting the maximum iteration times of training, and stopping training when the training reaches the maximum iteration times to obtain a trained LGSA model;
s900: and inputting the historical POI track sequence of the user to be predicted as the trained LGSA, and outputting the LGSA as a prediction result of the next POI of the user to be predicted.
Preferably, the local feature vector representation Loc of each user in the spatio-temporal region is calculated in S310 u The method comprises the following specific steps:
s311: randomly selecting a historical POI track sequence of a user, and carrying out time interval processing on the historical POI track sequence of the user, wherein the specific expression is as follows:
Figure BDA0003864635210000033
wherein,
Figure BDA0003864635210000034
representing the time interval, t, between the visit to location i and location j of the user i Time stamp, t, indicated at location i j A timestamp representing the location j;
and carrying out geographical distance processing on the historical POI track sequence of the user, wherein the specific expression is as follows:
Figure BDA0003864635210000035
wherein,
Figure BDA0003864635210000036
representing the geographic distance between visit location i and location j, r represents the radius, lon i And lat i GPS representing location i i Latitude and longitude, lon j And lat j GPS representing location j j Haversene (·) represents a geographical distance function;
s312: dividing the historical POI track sequence of the user according to the time interval and the geographic distance to obtain a spatio-temporal region set Reg u The specific expression is as follows:
Reg u ={reg 1 ,reg 2 ,…,reg x }; (9)
wherein reg x Representing the xth spatio-temporal region, x representing the number of spatio-temporal regions;
s313: dividing each space-time region in the space-time region set into fine-grained subsequences by using a sliding window w, wherein the specific expression is as follows:
Figure BDA0003864635210000041
wherein w represents the size of the sliding window;
s314: computing subsequence characteristics of fine-grained subsequences
Figure BDA0003864635210000042
The calculation expression is as follows:
Figure BDA0003864635210000043
wherein, W 1 Representing a learnable parameter, M a ∈R w×d Representing an adaptive adjacency matrix, d representing a characteristic dimension, tanh representing an activation function, and sub-sequence embedding within a region represented as
Figure BDA0003864635210000044
S315: computing
Figure BDA0003864635210000045
The expression is calculated as follows:
Figure BDA0003864635210000046
wherein, at l Representing an attention score matrix, W 2 、W 3 、b 1 And b 2 Both represent learnable parameters, and Softmax represents an activation function;
s316: using At l And
Figure BDA0003864635210000047
calculating to obtain the local characteristic vector representation Loc of the user in the space-time area u
S317: traversing all historical POI track sequences of the users in the training set, and calculating to obtain the local feature vector representation of each user in the space-time area.
The method can effectively mine the characteristics of the sites in the space-time region subsequence and the information of the surrounding associated sites, and obtain the interest preference of the user in the local specific space-time region range.
Preferably, the global feature vector representation Glo of the user in the space-time region is calculated in S320 u The method comprises the following specific steps:
s321: randomly selecting a user history POI track sequence, fusing time information in the user history POI track sequence, and calculating an expression as follows:
Figure BDA0003864635210000048
wherein,
Figure BDA0003864635210000049
representing a sequence of historical POI trajectories of a user after completion of time information fusion, W 4 A representation of the parameters that can be learned,
Figure BDA00038646352100000410
a splicing vector representing the track sequence and a special time period;
s322: computing
Figure BDA00038646352100000411
Non-invasive self-attention of
Figure BDA00038646352100000412
The calculation expression is as follows:
Figure BDA00038646352100000413
wherein, N represents N layers of multi-head Attention network layer, attention (·) represents Attention function, Q, K, V are respectively selected from
Figure BDA0003864635210000051
And S u Learnable matrix, K, obtained by mapping T A transpose matrix representing K, σ representing a learnable parameter;
s323: calculating the attention of the N layers of multiple heads, and calculating the expression as follows:
Figure BDA0003864635210000052
Figure BDA0003864635210000053
wherein,
Figure BDA0003864635210000054
is the y-th multi-head attention network layer, A h Is the output of the multi-head attention layer, GWLU denotes the Gaussian error Linear Unit, W 5 、W 6 、b 5 And b 6 Represents a learnable parameter;
s324: performing layer normalization processing and dropout function processing on the output of each sub-layer to obtain global feature vector representation Glo of the user on a space-time area u
S325: and traversing all historical POI track sequences of the users in the training set, and calculating to obtain the global feature vector representation of each user in a space-time area.
The method focuses on a user dynamic sequence, namely global characteristics, can effectively capture the dynamic preference and long-term semantics of the change of user behaviors along with time, and excavates relevant places in a track sequence.
Preferably, the specific steps of performing time information fusion in S321 are as follows:
s321-1: per userThe historical track sequence is
Figure BDA0003864635210000055
A user has a particular temporal pattern in the sequence of historical POI tracks,
Figure BDA0003864635210000056
wherein,
Figure BDA0003864635210000057
representing a location-representing vector in a sequence of trajectories, t i A presentation vector representing a special time period, u representing a user, and week representing the special time period in weeks;
s321-2: converting POI sign-in time into a special time period taking a week as a unit according to time unit conversion to obtain an embedded matrix of the special time period
Figure BDA0003864635210000058
Calculating an embedding matrix E (S) of the track sequence according to the word2vec word embedding method u );
S321-3: will be provided with
Figure BDA0003864635210000059
And E (S) u ) Splicing on the characteristic dimension to obtain a splicing matrix
Figure BDA00038646352100000510
The specific expression is as follows:
Figure BDA00038646352100000511
wherein con (·) represents a splicing function;
s321-4: using pairs of activation functions
Figure BDA00038646352100000512
Processing to obtain a user history POI track sequence after time information fusion is completed
Figure BDA00038646352100000513
The local features comprise the fact that the dependency relationship of the POIs of the user in the space-time area is learned, the global features can obtain the dynamic preference of the user to a special time period, and therefore the behavior preference of the user can be captured on the space-time level more effectively on the basis of considering the track sequence by combining the local features and the global features.
Compared with the prior art, the invention has at least the following advantages:
1. the invention discloses a POI prediction method based on space-time perception and combined with local and global preferences, which is used for predicting the next POI. And dividing the track sequence of each user into personalized space-time areas according to the geographical distance and the time interval, and learning the dependence of the user among POIs in the check-in areas from the local view. In addition, the dynamic preference of the user changing along with the time is mined by utilizing time information fusion and taking fine-grained time as one week, and the week change period characteristic can well reflect the specific activity of the user historical track every week; and fusing the track sequence and the time period of the sequence of the user in a non-invasive mode, and mining the dynamic preference of the user to the time period from the global view. And finally, performing feature fusion on the local features and the global features to obtain total preference features, and finally obtaining the next POI prediction point of the user by using the total preference features.
2. The present invention proposes an LGSA model that learns user preferences from local (i.e., personalized spatiotemporal regions) and global (i.e., sequences of trajectories with time periods) views based on a user's historical POI trajectory sequences.
3. In order to effectively learn the local dependency relationship in the time-space area, the invention provides a personalized time-space sensing area, the personalized time-space area is divided for each user according to the geographic distance and the time interval in the track sequence, the dependency relationship among POIs signed in by the user in the time-space area is learned from the local view, and the method can reduce the correlation of POIs in different time-space areas in the track sequence, thereby improving the prediction result.
4. In order to fully integrate the track sequence and the personalized time period, the invention uses a non-invasive mode to fuse the track sequence of the user and the time period of the sequence, and excavates the dynamic preference of the user and the POI time sequence of the track sequence on the time period from the global view, and the mode can not cover track information and can well extract the relationship between the track sequence and the cycle variation period.
Drawings
Fig. 1 is a diagram of an LGSA structural framework including local features and global features in the present invention.
FIG. 2 is a schematic diagram of the present invention for dividing spatio-temporal regions using time intervals and geographic distances.
FIG. 3 is a comparison of performance on the NYC data set in the experiments of the present invention.
FIG. 4 shows a comparison of the performance on the TKY data set in the experiments of the present invention.
FIG. 5 is a comparison of performance on the BrightKite dataset in the experiments of the present invention.
FIG. 6 is a batch parameter experiment of the present invention experiment.
FIG. 7 is a spatiotemporal threshold parameter experiment in an experiment of the present invention.
Detailed Description
The present invention is described in further detail below.
The invention discloses a method for predicting the next POI by combining local preference and global preference based on space-time perception. Providing a local preference module according to the dependency between POIs in the personalized space-time area; then, modeling the global preference to mine the dynamic preference of the user in a specific time period; modeling preference aggregation can effectively fuse local features and global features to complete POI prediction.
Referring to fig. 1-2, a POI prediction method based on spatiotemporal perception and combining local and global preferences includes the following steps:
s100: selecting a public sign-on POIs data set as a training set O, wherein the training set O comprises user historical POI track sequences, and the historical POI track sequence of each user is represented as
Figure BDA0003864635210000071
Figure BDA0003864635210000072
Indicates that the user is at t s The interest point of the moment;
the historical POI tracks of the user are arranged according to a time sequence, and the historical POI track sequence of the user comprises a user tag, a time tag, a place tag and longitude and latitude corresponding to the place tag;
s200: constructing a POI prediction model LGSA, wherein the LGSA comprises a local feature module, a global feature module and a feature fusion module;
s300: randomly selecting a user history POI track sequence from the training set O, and calculating the local feature vector representation and the global feature vector representation of the user history POI track sequence:
s310: taking the historical POI track sequence of the user as input, and calculating the local feature vector representation Loc of the user on a space-time area by using a local feature module u The expression is as follows:
Figure BDA0003864635210000073
where T represents the matrix transpose, avg (-) represents the averaging function, tanh (-) represents the activation function, at l A matrix of the attention scores is represented,
Figure BDA0003864635210000074
sub-sequence features representing fine-grained sub-sequences;
calculating local feature vector representation Loc of each user in the space-time region in the step S310 u The method comprises the following specific steps:
s311: randomly selecting a historical POI track sequence of a user, and carrying out time interval processing on the historical POI track sequence of the user, wherein the specific expression is as follows:
Figure BDA0003864635210000075
wherein,
Figure BDA0003864635210000076
representing the time interval, t, between the visit to location i and location j of the user i Time stamp, t, indicated at location i j A timestamp representing the location j;
and performing geographical distance processing on the historical POI track sequence of the user, wherein the specific expression is as follows:
Figure BDA0003864635210000077
wherein,
Figure BDA0003864635210000078
representing the geographic distance between visit location i and location j, r represents the radius, lon i And lat i GPS representing location i i Latitude and longitude, lon j And lat j GPS representing location j j Haversene (-) represents a geographic distance function;
s312: dividing the historical POI track sequence of the user according to the time interval and the geographic distance to obtain a spatio-temporal region set Reg u The specific expression is as follows:
Reg u ={reg 1 ,reg 2 ,…,reg x }; (9)
wherein reg x Representing the xth spatio-temporal region, x representing the number of spatio-temporal regions;
the time interval between the positions in the track sequence is in minutes, and the time interval is threshold value theta t And a geographic distance threshold θ g All used for dividing space-time regions; specifically, time intervals and geographical distances of the track sequences are calculated, and different median values of the time intervals and the geographical distances are respectively set as thresholds for dividing space-time regions; thus, each sequence yields a different number of spatio-temporal regions, which are considered as local features in the present invention.
S313: dividing each space-time region in the space-time region set into fine-grained subsequences by using a sliding window w, wherein the sliding window is an existing known experimental strategy and has the following specific expression:
Figure BDA0003864635210000081
wherein w represents the size of the sliding window; the experimental strategy can help the model to pay more attention to the relation between adjacent sign-in places in the time-space region, and neglect irrelevant places with small influence; for each user, a corresponding space-time region set is provided, a sliding window is used for each space-time region of the user to generate a subsequence set, and the number of the subsequence sets is determined by the size of the sliding window.
S314: computing subsequence features for fine-grained subsequences
Figure BDA0003864635210000082
The calculation expression is as follows:
Figure BDA0003864635210000083
wherein, W 1 Representing a learnable parameter, M a ∈R w×d Representing an adaptive adjacency matrix, d representing a characteristic dimension, and tanh representing an activation function, the activation function being used to make the matrix range from-1 to 1; sub-sequence embedding within a region is represented as
Figure BDA0003864635210000084
Because the subsequence is not an inherent graph of GNN modeling, a graph needs to be constructed to capture the connection between positions, edges are added between the positions in the subsequence, the number of the edges of the item pairs extracted from all users is calculated, an adaptive adjacency matrix is established, the adjacency matrix is normalized according to the number of the edges, and the adaptive adjacency matrix can automatically learn the dependency relationship between subsequence locations in the region.
S315: calculating out
Figure BDA0003864635210000085
The expression is calculated as follows:
Figure BDA0003864635210000086
wherein, at l Representing an attention score matrix, W 2 、W 3 、b 1 And b 2 Both represent learnable parameters, and Softmax represents an activation function; two layers of GNN are used to aggregate information, which is to well mine the information of the characteristics of the subsequences in the space-time region and the surrounding sites; the attention score matrix may assign an attention weight to each location, extracting locations that the user is more interested in the local area.
S316: using At l And
Figure BDA0003864635210000091
calculating to obtain the local characteristic vector representation Loc of the user in the space-time area u
S317: traversing all historical POI track sequences of the users in the training set, and calculating to obtain the local feature vector representation of each user in the space-time area.
S320: taking the historical POI track sequence of the user as input, calculating the global feature vector representation Glo of the user in week time unit by using a global feature module u The expression is as follows:
Glo u =LN(A h +Dropout(PFFN(A h ))); (2)
wherein A is h Representing the output of the features after multi-headed attention, LN (-) represents the layer normalization in the neural network, dropout (-) represents the method adopted to prevent model overfitting, PFFN (-) represents the forward feed-forward network;
calculating global feature vector representation Glo of user on spatio-temporal region in S320 u The method comprises the following specific steps:
s321: randomly selecting a user history POI track sequence, fusing time information in the user history POI track sequence, and calculating an expression as follows:
Figure BDA0003864635210000092
wherein,
Figure BDA0003864635210000093
representing a sequence of historical POI trajectories of a user after completion of time information fusion, W 4 The representation of the learnable parameter is,
Figure BDA0003864635210000094
a splicing vector representing the track sequence and a special time period;
the specific steps of time information fusion in S321 are as follows:
s321-1: the historical track sequence of each user is
Figure BDA0003864635210000095
A user has a particular temporal pattern in the sequence of historical POI tracks,
Figure BDA0003864635210000096
wherein,
Figure BDA0003864635210000097
representing a location-representing vector in a sequence of trajectories, t i A presentation vector representing a special time period, u representing a user, and week representing the special time period in weeks;
s321-2: converting POI sign-in time into a special time period with a week as a unit according to time unit conversion to obtain an embedded matrix of the special time period
Figure BDA0003864635210000098
Calculating an embedding matrix E (S) of the track sequence according to the word2vec word embedding method u ) The word2vec word embedding method is the prior art;
s321-3: will be provided with
Figure BDA0003864635210000099
And E (S) u ) Splicing on the characteristic dimension to obtain a splicing matrix
Figure BDA00038646352100000910
The specific expression is as follows:
Figure BDA00038646352100000911
wherein con (·) represents a splicing function;
s321-4: using pairs of activation functions
Figure BDA00038646352100000912
Processing to obtain a user history POI track sequence after time information fusion is completed
Figure BDA00038646352100000913
S322: computing
Figure BDA00038646352100000914
Non-invasive self-attention of
Figure BDA00038646352100000915
The calculation expression is as follows:
Figure BDA0003864635210000101
wherein, N represents N layers of multi-head Attention network layer, attention (·) represents Attention function, Q, K, V are respectively selected from
Figure BDA0003864635210000102
And S u Learnable matrix, K, obtained by mapping T A transpose matrix representing K, σ representing a learnable parameter;
s323: calculating the attention of the N layers of multiple heads, and calculating the expression as follows:
Figure BDA0003864635210000103
Figure BDA0003864635210000104
wherein,
Figure BDA0003864635210000105
is the y-th multi-head attention network layer, A h Is the output of the multi-head attention layer, GELU denotes the Gaussian error Linear Unit, W 5 、W 6 、b 5 And b 6 Represents a learnable parameter;
s324: performing layer normalization processing and dropout function processing on the output of each sub-layer to obtain global feature vector representation Glo of the user on a space-time area u
S325: and traversing all historical POI track sequences of the users in the training set, and calculating to obtain the global feature vector representation of each user in the space-time area.
S400: setting an initial weight coefficient alpha, and fusing the Loc by using a feature fusion module u And Glo u Combining, namely aggregating the interests of the user, and fusing the local features and the global features through weighted summation to obtain the total preference features C of the user u The specific expression is as follows:
C u =αLoc u +(1-α)Glo u ; (3)
wherein alpha is a weight coefficient, and alpha is [0,1]](ii) a The combination of local and global features can more effectively capture the behavior preference of the user on a spatio-temporal level, rather than only considering the trajectory sequence; the two feature representations are combined to well complete the position prediction work, the combination is obtained by fusing local features and global features through weighted summation, and the value of alpha is selected from {0.0,0.1,0.2., 0.8,0.9,1.0} in sequence to carry out parameter experiment calculation C u Value, when C u Alpha value corresponding to the maximum valueAs the optimum alpha value.
S500: using global preference feature C u Calculating the predicted POI of the user, which comprises the following specific steps:
s510: calculating a predicted POI representation vector P for the user u The expression is as follows:
Figure BDA0003864635210000106
wherein,
Figure BDA0003864635210000107
representing the position in the track sequence to represent the characteristic, d represents the characteristic dimension, t represents time, co represents the characteristic relation among the positions in the user time space region, and the calculation expression of Co is as follows:
Figure BDA0003864635210000108
wherein,
Figure BDA0003864635210000109
the sub-sequences representing the spatio-temporal regions represent vectors, W r Are learnable parameters;
s520: mapping P by index u Mapping to a place label of the POI to obtain a predicted POI of the user; the index mapping is that a POI place label corresponds to a POI representation vector, and the POI place label and the POI representation vector are in one-to-one correspondence;
s600: calculating an objective function K of the LGSA model by using the predicted POI expression vector of the user, wherein the specific expression is as follows:
K=argmin∑ (u,pos,neg)∈O -log(σ(P u,pos -P u,neg )); (6)
wherein, P u,pos Representing the distance, P, of the real POI from the predicted POI representation vector u,neg Representing distances of POIs in the non-current user trajectory sequence from predicted POI representation vectors, u representing a user tag, pos representing a real POI tag, neg representing the non-current user trajectory sequenceThe sigma represents a sigmoid function, the target function expresses the distance between a POI vector predicted by zooming-in and a true value vector and the distance between the POI vector predicted by zooming-out and a negative sampling vector, and the negative sampling vector is the POI value of a non-current user, namely the POI which is not signed in by the current user; the objective function argmin uses a Bayes personalized sorting objective function;
s700: training the LGSA model by using the target function K as a loss function, and meanwhile, reversely updating LGSA model parameters by using a gradient descent method;
s800: traversing all historical POI track sequences of the users in the training set, repeating the steps S300-S700 to train the model, presetting the maximum iteration times of training, and stopping training when the training reaches the maximum iteration times to obtain a trained LGSA model;
s900: and inputting the historical POI track sequence of the user to be predicted as the trained LGSA, and outputting the LGSA as a prediction result of the next POI of the user to be predicted.
Experimental verification
1. Data set
The experimental evaluation of the present invention was performed on two common LBSN datasets listed below, which are known public datasets with relatively high confidence. The details of the data set are shown in table 1.
Foursquare dataset: foursquare is a location-based social networking site, with users sharing their location by sign-on. The data set includes long-term (about 10 months) check-in data collected from Foursquare from 12 months 12 days 2012 to 16 months 2 months 2013 from tokyo, in the present invention, users with less than 10 POIs visited and POIs with less than 10 people visited are deleted, and by preprocessing, the data set for new york city contains 134,691 check-ins and 4,513 POIs for 1,078 users, while the data set for tokyo contains 401,857 check-ins and 6,952 POIs for 2,266 users.
Brightkit dataset: brightkit was once a location-based social networking service provider, with users sharing their locations by sign-on. While this dataset contains check-in records generated on brightkites from 4 months 2008 to 10 months 2010, the top 10000 users were selected in this experiment, users visited less than 10 POIs or more than 1000 POIs, and POIs visited fewer than 10 people were deleted, and the brightkites dataset contains 884,373 check-ins and 19,034 POIs for 5153 users, pre-processed.
In the experiment, the first 80% of sequences of each user are used as a training set, the last 20% of sequences are used as a test set, and the historical tracks of the users are sorted according to the time sequence. More detailed information on the data set is given in table 1.
Table 1 data set statistics
Data set NYC TKY Brightkite
User' s 1,078 2,266 5,153
POIs 4,513 6,952 19,034
Number of POIs signed in 134,691 401,857 884,373
Average label per userNumber of entries 124.95 177.34 171.62
Average number of signed-in per POI 29.85 57.80 46.46
Degree of sparseness 97.235% 97.451% 99.098%
2. Base line
The present experiment focused primarily on the features of the trajectory sequence and the spatio-temporal effects between POIs to predict the next POI, and therefore, the LGSA proposed by the present invention was compared to the following baseline model.
TOP: the method records the popularity of the POIs in the data set and recommends the most popular POIs to the user.
ST-RNN: the method establishes specific time transfer matrixes at different time intervals and establishes specific distance transfer matrixes at different geographical distances for prediction of the next place.
HGN: the method combines a hierarchical gating network and Bayesian personalized ranking, and utilizes long-term and short-term interests of users to perform sequential recommendation.
MA-GNN: the method uses a memory-enhanced graphical neural network to capture long-term and short-term interests of a user for sequential recommendations.
STAN: the method uses a spatiotemporal attention network to aggregate all relevant visits from the user's trajectory and recall the most reasonable candidates from the weighted tokens for location recommendation.
3. Evaluation index
According to the previous settings, the experiment used four evaluation indexes for the next POI prediction task, these evaluation indexes being precision @10, recall @10, normalized discount cumulative benefit (ndcg @ 10) and average accuracy (map @ 10), where 10 is the number of POIs in the ranking list; when the correct POI is in the top 10 POIs, the scores of precision @10 and Recall @10 are high, NDCG @10 serves as an evaluation index of a ranking result and is used for evaluating the accuracy of ranking, MAP scores the quality of the whole ranking set, and the larger the values of the four evaluation indexes are, the better the performance is.
4. Details of the experiment
For the space-time threshold, the experiment is respectively carried out on a quarter digit, a three-quarter digit, a median and an average value of three digits of the threshold, and the median of the optimal result is taken as the threshold. The geographic distance and the time interval simultaneously exceed the median, and an area is divided. The sliding window size in the local region was chosen from {4,6,8,10} for experiments, respectively, and the results were optimal across the three datasets when L = 6.
In the LGSA model, an Adam optimizer is used for training the model, the learning rate is 0.001, and the regularization parameter is set to be 0.001; adjusting the hyper-parameters on the verification set through grid search; the embedding size is set to 100. The batch size for NYC and BrightKite is set to 2048, the batch size for TKY to 4096. For the spatiotemporal threshold, the average values of the time interval and the space interval are respectively used, 25%, 50% and 75% are used as the threshold of the experiment, and 50% with the best result is taken as the threshold; the spatiotemporal regions are partitioned when the geographic distance and time interval exceed the corresponding median in the sequence of historical POI trajectories of the user. The sliding window size w in the native feature was chosen from {4,6,8,10} for the experiment. When w is 6, the results are optimal on three data sets, the length of the trajectory sequence is set to 100, the local weight coefficient α is selected from {0.2,0.4,0.6,0.8,1.0} to perform the experiment, and when α is 0.4, the results are optimal.
5. As a result, the
As shown in 3,4,5, top is the least effective of the four evaluation indexes in baseline, which indicates that it is not feasible to simply obtain and predict the popularity of POI; HGN and MA-GNN are concerned about long-term and short-term preferences of users, the effect is obviously better than TOP, but the consideration of space-time characteristics is lacked, so the effect is lower than LGSP; ST-RNN and STAN are context features of the track obtained by mining the space-time feature of the track, but sequence features of the track and periodicity of the sequence are ignored, so the result is lower than that of LGSP.
The LGSP model is obviously superior to baseline in the index of NDCG @10, which shows that the model has good sequencing effect on the prediction result; secondly, on the index of recall @10, the model can well recall item sets to be predicted; however, in precision @10, the LGSP model is not as dominant and is only slightly better than baseline. On the TKY data set, the effect of LGSP on pre @10, NDCG @10 and MAP evaluation indexes is obviously superior to that of baseline, which shows that the prediction accuracy and the sequencing effect of the LGSP model are improved, but the recall is improved a little; the effect on the Brightkite dataset did not increase much, being a little better than baseline.
6. Experiment of parameters
In order to study the influence of different settings on the key hyper-parameters, the LGSP model was evaluated by varying the batch size of the relevant item sets and the size of the spatio-temporal threshold, respectively:
first, the batch size is changed. From 256 to 4096, as shown in fig. 6. It shows that on the new york city and Brightkite datasets, higher performance is achieved when the batch size is 2048, while on the TKY dataset, the batch size is 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 an inadequate fit.
Second, the spatiotemporal threshold is targeted. In the experiment, the threshold values of the average value, the lower quartile, the median value and the upper quartile are tested, and the results shown in fig. 7 show that on three data sets, when the time-space threshold value is the median value, higher performance is obtained; this shows that the user's personalized spatio-temporal regions can be well divided based on the median spatio-temporal threshold; the average values neglect the distribution of time intervals and geographical distances, and the existence of abnormal values easily expands or contracts the result; neither the lower quartile nor the upper quartile can accurately grasp the spatiotemporal region of user activity.
7. Ablation experiment
Ablation studies of the LGSA model were performed on NYC, TKY and Brightkite datasets, including four aspects: consider only Local Features (LF), consider only Global Features (GF), combine local and global features (LF + GF), and blend periods of local and global features (LF + GF + time). The results are shown in Table 2.
TABLE 2 ablation test results on NYC, TKY and Brightkite data sets
Figure BDA0003864635210000141
From experimental results, when only the global feature is available, the performance result on the TKY data set is the worst, which indicates that the spatio-temporal region of the user in the TKY data set is a very important feature, and the user on the platform is biased to move in the spatio-temporal region; as can be seen from the three data sets, the sequence of historical POI tracks of the user, namely the dynamic preference changing along with time, is considered globally, and the personalized space-time area of the user is considered locally and the dependency among the POIs is mined for predicting the next POI; from the experimental results, it can be seen that the time period characteristics do not improve the performance of the model greatly, because the time period is considered in a global view, and the weight of the time period in the model structure is not large.
Finally, the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all of them should be covered in the claims of the present invention.

Claims (4)

1. A POI prediction method based on space-time perception and combining local and global preferences is characterized by comprising the following steps: the method comprises the following steps:
s100: selecting a public sign-on POIs data set as a training set O, wherein the training set O comprises user historical POI track sequences, and the historical POI track sequence of each user is represented as
Figure FDA0003864635200000011
Figure FDA0003864635200000012
Indicates that the user is at t s The interest point of the moment;
the historical POI tracks of the user are arranged according to a time sequence, and the historical POI track sequence of the user comprises a user tag, a time tag, a place tag and longitude and latitude corresponding to the place tag;
s200: constructing a POI prediction model LGSA, wherein the LGSA comprises a local feature module, a global feature module and a feature fusion module;
s300: randomly selecting a user history POI track sequence from the training set O, and calculating the local feature vector representation and the global feature vector representation of the user history POI track sequence:
s310: taking the historical POI track sequence of the user as input, and using a local feature module to calculate the local feature vector representation Loc of the user on a space-time area u The expression is as follows:
Figure FDA0003864635200000013
where T represents the matrix transpose, avg (-) represents the averaging function, tanh (-) represents the activation function, at l A matrix of the attention scores is represented,
Figure FDA0003864635200000014
sub-sequence features representing fine-grained sub-sequences;
s320: taking the historical POI track sequence of the user as input, calculating the global feature vector representation Glo of the user in week time unit by using a global feature module u The expression is as follows:
Glo u =LN(A h +Dorpout(PFFN(A h ))); (2)
wherein A is h Representing the output of the features after multi-headed attention, LN (-) represents the layer normalization in the neural network, dropout (-) represents the method adopted to prevent model overfitting, PFFN (-) represents the forward feed-forward network;
s400: setting an initial weight coefficient alpha, and fusing the Loc by using a feature fusion module u And Glo u Combining, fusing the local features and the global features through weighted summation to obtain the total preference features C of the user u The specific expression is as follows:
C u =αLoc u +(1-α)Glo u ; (3)
wherein, alpha represents a weight coefficient, and is within the range of [0,1];
s500: using global preference feature C u Calculating the predicted POI of the user, which comprises the following specific steps:
s510: calculating a predicted POI representation vector P for the user u The expression is as follows:
Figure FDA0003864635200000015
wherein,
Figure FDA0003864635200000016
representing the position in the track sequence to represent the characteristic, d represents the characteristic dimension, t represents time, co represents the characteristic relation among the positions in the user time space region, and the calculation expression of Co is as follows:
Figure FDA0003864635200000021
wherein,
Figure FDA0003864635200000022
representing a spatio-temporal regionThe subsequence of fields represents a vector, W r Are learnable parameters;
s520: mapping P by index u Mapping to the place label of the POI to obtain the predicted POI of the user; the index mapping is that a POI place label corresponds to a POI representation vector, and the POI place label and the POI representation vector are in one-to-one correspondence;
s600: calculating an objective function K of the LGSA model by using the predicted POI expression vector of the user, wherein the specific expression is as follows:
K=argmin∑ (u,pos,neg)∈O -log(σ(P u,pos -P u,neg )); (6)
wherein, P u,pos Representing the distance, P, of the real POI from the predicted POI representation vector u,neg Representing the distance between the POI in the non-current user track sequence and the predicted POI representation vector, u representing a user tag, pos representing a real POI tag, neg representing the POI tag in the non-current user track sequence, and sigma representing a sigmoid function;
s700: training the LGSA model by using the target function K as a loss function, and meanwhile, reversely updating LGSA model parameters by using a gradient descent method;
s800: traversing all historical POI track sequences of the users in the training set, repeating the steps S300-S700 to train the model, presetting the maximum iteration times of training, and stopping training when the training reaches the maximum iteration times to obtain a trained LGSA model;
s900: and inputting the historical POI track sequence of the user to be predicted as the trained LGSA, and outputting the LGSA as a prediction result of the next POI of the user to be predicted.
2. The POI prediction method based on spatio-temporal perception combined with local and global preferences of claim 1, characterized in that: calculating local feature vector representation Loc of each user in the space-time region in the step S310 u The method comprises the following specific steps:
s311: randomly selecting a historical POI track sequence of a user, and carrying out time interval processing on the historical POI track sequence of the user, wherein the specific expression is as follows:
Figure FDA0003864635200000023
wherein,
Figure FDA0003864635200000024
representing the time interval, t, between the visit to location i and location j of the user i Time stamp, t, indicated at location i j A timestamp representing the location j;
and performing geographical distance processing on the historical POI track sequence of the user, wherein the specific expression is as follows:
Figure FDA0003864635200000025
wherein,
Figure FDA0003864635200000026
representing the geographic distance between visit location i and location j, r represents the radius, lon i And lat i GPS representing location i i Latitude and longitude, lon j And lat j GPS representing location j j Haversene (·) represents a geographical distance function;
s312: dividing the historical POI track sequence of the user according to the time interval and the geographic distance to obtain a spatio-temporal region set Reg u The specific expression is as follows:
Reg u ={reg 1 ,reg 2 ,…,reg x }; (9)
wherein reg x Representing the xth spatio-temporal region, x representing the number of spatio-temporal regions;
s313: dividing each space-time region in the space-time region set into fine-grained subsequence by using a sliding window w, wherein the specific expression is as follows:
Figure FDA0003864635200000031
wherein w represents the size of the sliding window;
s314: computing subsequence characteristics of fine-grained subsequences
Figure FDA0003864635200000032
The calculation expression is as follows:
Figure FDA0003864635200000033
wherein, W 1 Representing a learnable parameter, M a ∈R w×d Representing an adaptive adjacency matrix, d representing a characteristic dimension, tanh representing an activation function, and embedding of subsequences within a region represented as
Figure FDA0003864635200000034
S315: computing
Figure FDA0003864635200000035
The expression is calculated as follows:
Figure FDA0003864635200000036
wherein, at l Representing an attention score matrix, W 2 、W 3 、b 1 And b 2 All represent learnable parameters, and Softmax represents an activation function;
s316: using At l And
Figure FDA0003864635200000037
calculating to obtain the local characteristic vector representation Loc of the user in the space-time area u
S317: and traversing all historical POI track sequences of the users in the training set, and calculating to obtain the local feature vector representation of each user in a space-time area.
3. The POI prediction method based on spatio-temporal perception combined with local and global preferences of claim 2, characterized in that: calculating global feature vector representation Glo of user on spatio-temporal region in S320 u The method comprises the following specific steps:
s321: randomly selecting a user history POI track sequence, fusing time information in the user history POI track sequence, and calculating an expression as follows:
Figure FDA0003864635200000038
wherein,
Figure FDA0003864635200000039
representing a sequence of historical POI trajectories of a user after completion of time information fusion, W 4 A representation of the parameters that can be learned,
Figure FDA00038646352000000314
a splicing vector representing the track sequence and a special time period;
s322: computing
Figure FDA00038646352000000310
Non-invasive self-attention of
Figure FDA00038646352000000311
The calculation expression is as follows:
Figure FDA00038646352000000312
wherein, N represents N layers of multi-head Attention network layer, attention (·) represents Attention function, Q, K, V are respectively selected from
Figure FDA00038646352000000313
And S u Learnable matrix, K, obtained by mapping T A transpose matrix representing K, σ represents a learnable parameter;
s323: calculating the attention of the N layers of multiple heads, and calculating the expression as follows:
Figure FDA0003864635200000041
Figure FDA0003864635200000042
wherein,
Figure FDA0003864635200000043
is the y-th multi-head attention network layer, A h Is the output of the multi-head attention layer, GELU denotes the Gaussian error Linear Unit, W 5 、W 6 、b 5 And b 6 Represents a learnable parameter;
s324: performing layer normalization processing and dropout function processing on the output of each sub-layer to obtain global feature vector representation Glo of the user on a space-time area u
S325: and traversing all historical POI track sequences of the users in the training set, and calculating to obtain the global feature vector representation of each user in the space-time area.
4. A POI prediction method based on spatio-temporal perception combined with local and global preferences as claimed in claim 3, characterized in that: the specific steps of time information fusion in S321 are as follows:
s321-1: the historical track sequence of each user is
Figure FDA0003864635200000044
A user has a particular temporal pattern in the sequence of historical POI tracks,
Figure FDA0003864635200000045
wherein,
Figure FDA0003864635200000046
representing a location-representing vector in a sequence of trajectories, t i A presentation vector representing a special time period, u representing a user, and week representing the special time period in weeks;
s321-2: converting POI sign-in time into a special time period taking a week as a unit according to time unit conversion to obtain an embedded matrix of the special time period
Figure FDA0003864635200000047
Calculating an embedding matrix E (S) of the track sequence according to the word2vec word embedding method u );
S321-3: will be provided with
Figure FDA0003864635200000048
And E (S) u ) Splicing on the characteristic dimension to obtain a splicing matrix
Figure FDA0003864635200000049
The specific expression is as follows:
Figure FDA00038646352000000410
wherein con (·) represents a splicing function;
s321-4: using pairs of activation functions
Figure FDA00038646352000000411
Processing to obtain a user history POI track sequence after time information fusion is completed
Figure FDA00038646352000000412
CN202211176462.XA 2022-09-26 2022-09-26 POI prediction method based on space-time perception and combined with local and global preferences Pending CN115510333A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211176462.XA CN115510333A (en) 2022-09-26 2022-09-26 POI prediction method based on space-time perception and combined with local and global preferences

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211176462.XA CN115510333A (en) 2022-09-26 2022-09-26 POI prediction method based on space-time perception and combined with local and global preferences

Publications (1)

Publication Number Publication Date
CN115510333A true CN115510333A (en) 2022-12-23

Family

ID=84506566

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211176462.XA Pending CN115510333A (en) 2022-09-26 2022-09-26 POI prediction method based on space-time perception and combined with local and global preferences

Country Status (1)

Country Link
CN (1) CN115510333A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116757369A (en) * 2023-08-22 2023-09-15 国网山东省电力公司营销服务中心(计量中心) Attention mechanism-based carbon emission analysis method and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116757369A (en) * 2023-08-22 2023-09-15 国网山东省电力公司营销服务中心(计量中心) Attention mechanism-based carbon emission analysis method and system
CN116757369B (en) * 2023-08-22 2023-11-24 国网山东省电力公司营销服务中心(计量中心) Attention mechanism-based carbon emission analysis method and system

Similar Documents

Publication Publication Date Title
CN110928993B (en) User position prediction method and system based on deep cyclic neural network
Liu et al. Dynamic spatial-temporal representation learning for traffic flow prediction
Chen et al. Curriculum meta-learning for next POI recommendation
CN105532030B (en) For analyzing the devices, systems, and methods of the movement of target entity
CN111506835B (en) Data feature extraction method fusing user time features and individual features
CN113139140B (en) Tourist attraction recommendation method based on space-time perception GRU and combined with user relationship preference
Liao et al. Multi-context integrated deep neural network model for next location prediction
CN112579922B (en) Interest point recommendation method based on user track
CN115545758B (en) Method and system for self-adaptive incremental site selection of urban service facilities
CN112598165B (en) Urban functional area transfer flow prediction method and device based on private car data
CN116976702B (en) Urban digital twin platform and method based on large-scene GIS lightweight engine
CN115510333A (en) POI prediction method based on space-time perception and combined with local and global preferences
CN116150511A (en) Next position recommending method based on space-time context and category preference
CN115408618A (en) Interest point recommendation method based on social relationship fusion position dynamic popularity and geographic features
Xiao et al. A contextual master-slave framework on urban region graph for urban village detection
CN116884222B (en) Short-time traffic flow prediction method for bayonet nodes
Zeng et al. LGSA: A next POI prediction method by using local and global interest with spatiotemporal awareness
CN111988744B (en) Position prediction method based on user moving mode
CN117271899A (en) Interest point recommendation method based on space-time perception
CN113032688B (en) Method for predicting access position of social network user at given future time
CN106779181A (en) Method is recommended by a kind of medical institutions based on linear regression factor Non-negative Matrix Factorization model
CN112749209B (en) Method for constructing mobile behavior patterns oriented to space-time data
CN115470362A (en) Interest point real-time recommendation method based on city space-time knowledge graph
CN115495661A (en) Self-adaptive interest point recommendation method based on long-term and short-term preference of user
CN114065024A (en) POI recommendation method based on user personalized life mode

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination