A point of interest recommendation method
By combining the location, category, and time information of points of interest with multi-head self-attention and cross-attention mechanisms, an interest point recommendation model is constructed, which solves the problem of insufficient accuracy of interest point recommendation in existing systems and achieves higher recommendation accuracy and user preference expression capabilities.
Patent Information
- Application Number
- CN202410745586.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2044-06-11
AI Technical Summary
Existing point-of-interest (POI) recommendation systems struggle to accurately capture the complex relationships between users and POIs, particularly in mitigating POI popularity bias and time-varying preferences, resulting in low recommendation accuracy.
An interest point recommendation method employing multi-head self-attention and cross-attention mechanisms is proposed. The method calculates the short-term activity hidden state through self-attention and the long-term preference tensor through cross-attention. Combining the location, category, and time information of interest points, an interest point recommendation model is constructed. The model's expressive power is enhanced by utilizing a pre-trained interest point embedding matrix and a frequency-gated network.
It improves the accuracy of interest point recommendations, better maintains consistency between short-term and long-term interests, adapts to complex application scenarios, and enhances the ability to express user preferences.
Smart Images

Figure CN118747239B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to point-of-interest (POI) recommendation technology, and more specifically to a method for recommending POIs. Background Technology
[0002] The collection of trajectory data has become ubiquitous due to its increasing applications across multiple sectors. For example, mobile devices, automobiles, logistics and transportation systems, and GPS trackers can all generate trajectory data. This data typically includes time and geographic location information, forming the trajectories of users, vehicles, or objects. Analysis of trajectory data is crucial for understanding user behavior, traffic flow management, route planning, and location services.
[0003] When processing trajectory data, POIs (Points of Interest) are an important component. They generally refer to specific points or locations within a map or geographic area that possess special interest or value.
[0004] Generally, a Point of Interest (POI) contains the following information:
[0005] Name: The name of the POI, such as the name of a shop, restaurant, attraction, etc.
[0006] Geographical Coordinates: The precise geographical location of a Point of Interest (POI), usually expressed in longitude and latitude, which is crucial information for navigation and positioning.
[0007] Category: The category or type to which the POI belongs. For example, restaurants, hotels, hospitals, parks, shopping malls, etc.; category information helps users find POIs based on their interests.
[0008] Operating Hours: The opening and closing times of the POI so that users know when they can access it.
[0009] Other descriptive information about the POI, such as contact details, pictures, and special services or facilities.
[0010] This information is typically stored as structured data in geographic information databases or map services, allowing users to easily search, browse, and retrieve information related to Points of Interest (POIs). This data is extremely useful for navigation, travel planning, location search, and geographic analysis.
[0011] In the real world, there are many scenarios involving next Point of Interest (POI) recommendations, such as predicting the destination of a trajectory. This helps navigation applications and route planning, and identifies abnormal behaviors in trajectories, such as traffic accidents or emergencies. The human mobility problem addresses this by building models to effectively utilize and mine known POIs to predict the next POI for humans.
[0012] In existing point-of-interest recommendation systems, traditional recommendation methods are mainly pattern-based or data-driven, such as Markov chains and matrix factorization [Where you like to go next: Successive point-of-interest recommendation, in Proceedings of the Twenty-Third International Joint Conference on Artificial Intelligence, ser. IJCAI13.AAAIPress, 2013, pp. 2605–2611.]. Meanwhile, collaborative filtering-related methods have also achieved some results, but still face problems such as data sparsity and cold start.
[0013] Furthermore, the relationships between users and points of interest are complex and diverse, influenced by various factors such as geographical location, social relationships, and time periods, making it difficult for traditional point-based recommendation methods to accurately capture these relationships. Therefore, effectively representing and modeling these complex relationships has become crucial for improving the performance of recommendation systems.
[0014] With the widespread application of deep learning technology, research related to interest point recommendation has also been inspired. Deep recurrent neural networks (RNNs) and their variants LSTM and GRU are able to capture the dependencies between sequences very well and have been widely used. For example, DeepMove [Deepmove: Predicting human mobility with attentional recurrent networks, in Proceedings of the 2018 World Wide Web Conference, 2018, pp. 1459–1468] uses recurrent neural networks to learn human mobility short-term and long-term preferences, and then combines the two to improve accuracy.
[0015] While RNNs perform remarkably well in sequence learning, their computational speed limits their application to long sequences. Therefore, attention mechanisms, with their ability to learn global dependencies, have garnered significant attention. For example, CFRREc [“Next point-of-interest recommendation with inferring multi-step future preferences,” in Proceedings of the 31st International Joint Conference on Artificial Intelligence (IJCAI), 2022, pp. 3751–3757.] uses a self-attention network to capture users' historical preferences, calculates the distance from a point to a prediction point to classify POIs, and assigns different attention weights to accurately predict the next user's preferences.
[0016] However, current deep neural network models still face the following key problems in human mobility recommendation:
[0017] I. How to mitigate the problem of POI popularity bias in recommendation and improve the information content of the latent space vector of POI representation learning, so as to ensure that the target POI can be more accurately located near the relevant semantic information when recommending it;
[0018] Second, how to learn from users' time-varying preferences to further capture the interdependence between the sequence relationship of POIs and user personalization, so as to improve the model's personalized recommendation capabilities.
[0019] Therefore, we believe that maintaining consistency between short-term and long-term interests, as well as a good classifier, are equally important. Summary of the Invention
[0020] The technical problem to be solved by this invention is to propose an interest point recommendation method that can maintain the consistency between short-term and long-term interests and improve the accuracy of predicting the user's next interest point.
[0021] The technical solution adopted by the present invention to solve the above-mentioned technical problems is as follows:
[0022] An interest-based recommendation method includes the following steps:
[0023] A. Training the interest point recommendation model
[0024] A1. Constructing the training set
[0025] Obtain check-in data, which includes check-in user tags and check-in interest point information, including interest point tags, location information of interest points, and check-in time;
[0026] Based on the check-in user information, the interest point information of each user is extracted from the check-in data and arranged according to the timeline to construct the historical trajectory of each user; the historical trajectory of each user is divided according to the preset time interval to obtain a set of training trajectories for each user; for each training trajectory, the last interest point arranged according to the timeline is taken as the real check-in, and the trajectory composed of the remaining interest points other than the real check-in constitutes the current trajectory.
[0027] Each training sample is constructed based on the current trajectory. The training sample includes the current trajectory, real check-ins belonging to the same training trajectory as the current trajectory, and the historical trajectory to which the training trajectory to which the current trajectory belongs belongs. A training set is constructed based on the training samples.
[0028] A2. Extract at least one training sample from the training set as the input for this round of training; process each input training sample according to the following steps:
[0029] A21. Encode each point of interest contained in the historical trajectory of the input training sample to obtain the embedding representation of each point of interest; add a position encoding vector to the embedding representation of each point of interest according to the order of the check-in time of each point of interest to obtain the feature representation of each point of interest.
[0030] A22. Using the feature representations of each interest point contained in the current trajectory of the input training sample as input, perform self-attention calculation on each interest point contained therein, and obtain the short-term activity hidden state of the training sample based on the self-attention score.
[0031] A23. Using the feature representations of each interest point contained in the historical trajectory of the input training sample, concatenate them to form the feature matrix of the historical trajectory; using the feature matrix of the historical trajectory and the short-term activity hidden state of the training sample, obtain the long-term preference tensor of the training sample based on the cross-attention mechanism.
[0032] A24. Based on the short-term activity hidden state and long-term preference tensor of the input training samples, use an inference network to predict the next point of interest.
[0033] A3. Based on the predicted interest points and actual check-ins of each training sample in this round of training, calculate the cross-entropy loss, and update the model parameters using gradient descent according to the cross-entropy loss.
[0034] A4. Repeat steps A2-A3 until the training termination condition is met to obtain the trained interest point recommendation model.
[0035] B. Perform the recommended task:
[0036] Using all the check-in data of the user to be recommended, construct their historical trajectory; according to the preset time interval, using the check-in data of the user to be recommended according to the last time interval of the timeline, construct their current trajectory; then, using the historical trajectory and the current trajectory as input, use the trained interest point recommendation model to output the next interest point.
[0037] Furthermore, in step A24, the inference network includes an interest point classifier composed of a fully connected network: based on the short-term activity hidden state of the input training samples. and long-term preference tensor Using an interest point classifier, predict the next interest point according to the following formula:
[0038]
[0039] in, Let W be the probability distribution vector of the predicted (n+1)th point of interest across all points of interest, where b represents the index of the training sample; p and b p V represents the trainable parameters of the fully connected network that constitutes the interest point classifier, and Softmax represents the Softmax function; near This is a matrix of neighboring locations;
[0040] The nearest location matrix V near The dimension is B×N, where B represents the number of training samples in this round of training input, and N represents the number of interest points in the interest point set. The interest point set is the set composed of all interest points in the check-in data described in step A1. For the current trajectory of each training sample in this round of training input, the last interest point in its timeline arrangement is extracted as its prediction reference point. The distance between each interest point in the interest point set and each prediction reference point is calculated. If the distance meets the distance threshold, then in V near The corresponding element in the table is assigned the value α, otherwise it is assigned the value 1; α is a preset coefficient and α>1.
[0041] Furthermore, the check-in data includes check-in user tags and check-in point of interest information. The point of interest information includes point of interest tags, as well as the location information, category information, and check-in time of the point of interest. The category information of the point of interest includes category tags.
[0042] In step A21, each interest point contained in the historical trajectory of the input training sample is encoded to obtain the embedding representation of each interest point, specifically including:
[0043] A211. Input the points of interest contained in the historical trajectory of the training samples;
[0044] A212. Based on the interest point information, the first coding network is used to obtain the initial embedding representation of the input interest point; the second coding network is used to obtain the category embedding representation of the input interest point; and the third coding network is used to obtain the temporal embedding representation of the input interest point.
[0045] A213. By aggregating the initial embedding representation of the input interest point, its category embedding representation and temporal embedding representation are fused to obtain the final embedding representation of the input interest point.
[0046] Furthermore, the points of interest contained in the historical trajectories of the input training samples are used as input;
[0047] The first encoding network uses an interest point embedding matrix to obtain the embedding representation of each input interest point based on the mapping relationship between interest points and the interest point embedding matrix; the second encoding network uses a category encoding embedding matrix to obtain the category embedding representation of the input interest points based on the category information of the interest points; the third encoding network uses a time encoding embedding matrix to obtain the time embedding representation of the input interest points based on the check-in time of the interest points.
[0048] The interest point embedding matrix corresponds one-to-one with the interest points in the interest point set and is obtained through pre-training using contrastive learning and relation distillation. The interest point set is the set of all interest points in the check-in data described in step A1. The statistical frequency of each category is calculated using the category statistical frequency, and the category encoding embedding matrix is calculated based on the category statistical frequency. The statistical frequency of each time period is calculated using the check-in time of each interest point in the interest point set, and the time encoding embedding matrix is calculated based on the time period statistical frequency. The time period is obtained by subdividing the time interval used to divide the current trajectory in step A1.
[0049] Furthermore, the pre-training of the interest point embedding matrix includes:
[0050] C1. Data Preparation
[0051] Obtain the check-in data mentioned in step A1, construct an interest point set based on the interest point tags contained therein; construct and initialize an interest point embedding matrix, wherein the elements of the interest point embedding matrix correspond one-to-one with the interest points in the interest point set.
[0052] C2. Input an interest point p from the set of interest points. i , as the current anchor point;
[0053] C3. Extract the current anchor point p i Same category c k The points of interest constitute the current anchor point p. i The set of positive samples Dcp (c k From the set of points of interest, for the current anchor point p i Next point of interest p i+1 and the positive sample set D cp (c k Sampling is performed on other points of interest besides those already included, to construct the current anchor point p. i The set of negative samples, the next point of interest p i+1 For the current anchor point p i The trajectory belongs to the current anchor point p along the timeline. i Subsequent points of interest;
[0054] C4. Using the interest point embedding matrix, based on the mapping relationship between interest points and the interest point embedding matrix, obtain the anchor points and the embedding representations of each interest point in the positive and negative sample sets.
[0055] C5. Using the embedding representation of interest points obtained in step C4, perform relation distillation by comparing and learning between the anchor point and the interest points contained in the positive sample set and between the anchor point and the interest points contained in the negative sample set, and update the interest point embedding matrix.
[0056] C6. Repeat steps C2 to C5 until all interest points in the interest point set have been traversed, and the interest point embedding matrix is obtained.
[0057] Furthermore, in step C5, using the interest point embedding representation obtained in step C4, the interest point embedding matrix is updated by comparing and learning between the anchor point and the interest points contained in the positive sample set, and between the anchor point and the interest points contained in the negative sample set, according to the following formula: Relationship distillation is performed based on minimizing the expectation.
[0058]
[0059] in, Let s(·) represent minimizing the expectation, where P is the set of interest points, and s(·) represents the similarity calculation. i p is the current anchor point. i+1 For the current anchor point p i The trajectory belongs to the current anchor point p along the timeline. i The next point of interest, p r To obtain from the positive sample set D cp (c k A random value obtained from the current anchor point p) i Points of interest of the same category, p j Let v(p) be the j-th negative sample, and J represent the number of interest points sampled from the negative sample set; i ), v(p j ), v(p i+1) and v(p r ) represent p respectively i p j p i+j1 and p r Embedded representation.
[0060] Furthermore, the category encoding embedding matrix is obtained through the following steps:
[0061] The distribution of all interest points in the interest point set across all categories is statistically analyzed to obtain the statistical frequency of each category. A category coding one-hot matrix is established, wherein the row and column dimensions of the category coding one-hot matrix are the number of interest points and the number of categories in the interest point set, respectively, and the value of each element of the category coding one-hot matrix is the statistical frequency of the category to which the corresponding interest point belongs. Then, using the category coding one-hot matrix, a category coding embedding matrix is obtained through a fourth coding network.
[0062] The time-encoded embedding matrix is obtained through the following steps:
[0063] The time interval of dividing the training trajectory in step A1 is subdivided into time periods. The distribution of all interest points in the interest point set in each time period is statistically analyzed to obtain the statistical frequency of each time period. A time-coded one-hot matrix is established, wherein the row and column dimensions of the time-coded one-hot matrix are the number of interest points in the interest point set and the number of time periods, respectively. The value of each element of the time-coded one-hot matrix is the statistical frequency of the time period to which the corresponding interest point belongs. Using the time-coded one-hot matrix, the time-coded embedding matrix is obtained through the fifth coding network.
[0064] Furthermore, both the fourth and fifth coding networks employ linear transformations for encoding.
[0065] Using the following formula, the category-coded one-hot matrix A c And time-encoded one-hot matrix A t Through linear transformation, the category encoding embedding matrix V is obtained. c and time-coded embedding matrix V t :
[0066] V c =Tanh(A c W vc )
[0067] V t =Tanh(A t W vt )
[0068] Where Tanh represents the activation function, W vc and W vt These are the parameters of the linear transformation.
[0069] Furthermore, the aggregation network is a frequency-gated network; in step A213, the input interest point p is processed through the frequency-gated network according to the following formula. τ The initial embedding representation v(p) τ ), and fuse its category embedding representation v c (p τ ) and temporal embedding representation v t (p τ ), to obtain the final embedded representation v′(p) of the input interest point. τ ):
[0070] v′(p τ )=g(τ) p E mm (v(p τ ))+g(τ) c,t E gen (v c (p τ )+v t (p τ ))
[0071] g(τ) p =Sigmoid(W g *τ freq )
[0072] g(τ) c,t =1-g(τ) p
[0073] Among them, E mm Represents a memory network, E gen This represents a generalization network, where both the memory network and the generalization network are feedforward neural networks with the ELU activation function added; g(τ) p E mm (v(p τ )) represents the initial embedding representation v(p) τ The output of the frequency-gated network, g(τ) c,t E gen (v c (p τ )+v t (p τ )) represents the category embedding representation of points of interest v c (p τ ) and temporal embedding representation v t (p τ The output of the frequency-gated network; τ freq W represents the statistical frequency of the point of interest in the set of points of interest. g This represents the characteristic transformation matrix.
[0074] Furthermore, in step A21, firstly, based on the order of check-in times for each point of interest, the location code PE is obtained using an absolute location coding method. τ The embedding representation of each point of interest is given by the following formula: v′(p τ Add location encoding PE τ Obtain the feature representation v″(p) of each interest point. τ ):
[0075] v″(p τ )=v′(p τ )+PE τ
[0076] Where τ represents the position number of the point of interest in the trajectory according to its check-in time.
[0077] Furthermore, in step A22, self-attention is calculated for each interest point contained in the current trajectory of the input training sample, using the feature representation of each interest point as input, according to the following formula:
[0078]
[0079] Where softmax represents the Softmax function, T represents the matrix transpose, and d k S is the output dimension of the attention head. (h) Q represents the attention head score of the h-th head; (h) K (h) and V (h) These represent the Query value, Key value, and Value value obtained using the transformation matrix of the h-th head, respectively.
[0080] Then, calculate the self-attention score S for each attention head using the following formula. (h) The data is then fused and normalized to obtain the short-term activity representation S of the training samples. b :
[0081] S b =LayerNorm([S (1) ,S (2) ,…,S (h) …,S (H) W S +b S )
[0082] Where LayerNorm represents layer normalization, H represents the number of attention heads in multi-head self-attention, and W... s and b S , where are the trainable parameters of the fully connected network that fuses the outputs of H attention heads, and b represents the sequence number of the training sample;
[0083] Subsequently, S represents the short-term activity obtained. b Perform average pooling to obtain the short-lived activity hidden state.
[0084] Furthermore, in step A23, a feature matrix L of the historical trajectory is constructed using the feature representations of each interest point contained in the historical trajectory of the input training sample; the feature matrix L of the historical trajectory and the short-term activity hidden state of the training sample are then used. Cross-attention is calculated using the following formula:
[0085] z = Softmax(eW) a +b z (LU) l +b u )
[0086]
[0087] Among them, W s W l W a U l b z b u and b a All are learnable parameters; Tanb represents the activation function; Softmax represents the Softmax function;
[0088] Then, the output z of the cross-attention mechanism, after normalization, is compared with the short-term activity hidden state. Perform residual connections to obtain the long-term preference tensor.
[0089]
[0090] Where LayerNorm represents layer normalization, and b represents the sequence number of the training sample.
[0091] Furthermore, in step A24, the inference network further includes a category classifier composed of a fully connected network; and short-term activity hidden states based on the input training samples. and long-term preference tensor Using an interest point classifier, predict the category of the next interest point using the following formula:
[0092]
[0093] in, W represents the probability distribution vector of the predicted (n+1)th point of interest across all categories. c and b cThese represent the trainable parameters, and Softmax represents the Softmax function.
[0094] Furthermore, in step A3, the cross-entropy loss is calculated using the following formula:
[0095]
[0096] Among them, L b The cross-entropy loss is the value of the b-th training sample, where L is the total loss for this training round, and p is the cross-entropy loss. n+1 For the interest point labels of the actual check-ins of the b-th training sample, Let c be the probability distribution vector of the (n+1)th interest point predicted from the b-th training sample across all interest points. n+1 Let be the category label of the actual check-in for the b-th training sample. Let β be the probability distribution vector of the (n+1)th interest point predicted from the b-th training sample in each category, where β is a preset coefficient.
[0097] The beneficial effects of this invention are:
[0098] This invention presents an interest-point recommendation method. Compared to existing technologies, it employs multi-head self-attention for short-term user preference learning, enabling parallel computation that strengthens the model's expressive power and improves computational efficiency, allowing it to adapt to more complex application scenarios. For long-term user preference learning, it incorporates short-term preferences combined with cross-attention to calculate long-term preferences, ensuring consistency between short- and long-term preferences and enhancing the expressive power of user preferences, thereby improving the accuracy of predicting the user's next interest point. This invention has good practical applications in location services, intelligent traffic management, and social media recommendation. Attached Figure Description
[0099] Figure 1 This is a schematic diagram of the algorithm framework of the point of interest recommendation model in an embodiment of the present invention. Detailed Implementation
[0100] User preferences exhibit both cyclical characteristics and unique personalities. To overcome the limitations of traditional technologies that focus solely on short-term preferences, this invention provides an interest-based recommendation method. This method delves into users' long-term preferences through an attention mechanism and combines them with short-term preferences, ensuring consistency between long-term and short-term preferences and enhancing the expressive power of user preferences.
[0101] In its specific implementation, this invention constructs a user's historical trajectory and current trajectory respectively. Based on the check-in user information, the interest point information of each user is extracted from the check-in data and arranged according to the timeline to construct the historical trajectory of each user. The historical trajectory can reflect the user's long-term preferences. The current trajectory is constructed based on the check-in data included in the last time interval of the timeline. The current trajectory can reflect the user's short-term preferences. The time interval can be set as needed, such as one day.
[0102] Then, the last point of interest on the current trajectory's timeline is used as the prediction reference point. Using the feature representations of each point of interest contained in the current trajectory as input, self-attention is calculated for each point of interest. Based on the self-attention score of the prediction reference point, the short-term activity hidden state is obtained, and the user's short-term preferences are learned. Using the feature representations of each point of interest contained in the historical trajectory, a feature matrix of the historical trajectory is constructed to represent the user's long-term preferences. Utilizing the short-term activity hidden state and the feature matrix of the historical trajectory, a long-term preference tensor is obtained based on a cross-attention mechanism. By introducing short-term preferences combined with cross-attention, the consistency between short-term and long-term preferences is ensured, improving the expressive power of user preferences.
[0103] During training, to match historical trajectories with the current trajectory, firstly, based on the check-in user information, the interest point information of each user is extracted from the check-in data and arranged according to the timeline to construct the historical trajectory of each user; then, the historical trajectory of each user is divided according to a preset time interval to obtain a set of training trajectories for each user; for each training trajectory, the last interest point arranged according to the timeline is taken as the real check-in, and the trajectory composed of the remaining interest points excluding the real check-in constitutes the current trajectory; then, training samples are constructed based on each current trajectory, and a training set is constructed based on the training samples. The training samples include the current trajectory, the real check-ins belonging to the same training trajectory as the current trajectory, and the historical trajectory to which the training trajectory to which the current trajectory belongs.
[0104] As described above, the core of this invention lies in learning short-term and long-term preferences. Therefore, it can use existing encoding methods to encode points of interest, such as Node2Vec based on improved random walks. However, to enrich the expression of user preferences, based on the point of interest information, a first encoding network is used to obtain the initial embedding representation of the input point of interest; a second encoding network is used to obtain the category embedding representation of the input point of interest; a third encoding network is used to obtain the temporal embedding representation of the input point of interest; then, through aggregation, the initial embedding representation of the input point of interest is fused with its category embedding representation and temporal embedding representation to obtain the final embedding representation of the input point of interest.
[0105] The above aggregation can be done through weighted summation, splicing, etc. In this invention, a gating mechanism with frequency as input is further added to effectively balance the popularity preference of points of interest. This can effectively solve the problem of difficulty in accurately predicting when users come to some niche points of interest.
[0106] To better mine the latent vectors of interest points and obtain accurate feature information, this invention also introduces a pre-trained interest point embedding matrix. This matrix corresponds one-to-one with each interest point in the interest point set. Using this matrix, and based on the mapping relationship between interest points and the embedding matrix, the embedding representation of each input interest point is obtained. The interest point embedding matrix is obtained through contrastive learning, using relation distillation. This contrastive learning approach narrows the distance between interest points and those of the same category, while widening the distance between interest points and those of different categories, thereby improving the discriminative power of the embedded representation of interest points.
[0107] Furthermore, by using the geographical distance of points of interest as a threshold in the classifier, some unreasonable prediction points were filtered out, effectively improving the classification performance of the model.
[0108] In addition, since category information is added as guidance in the encoding, interest points of the same category are closer in the latent space. Correct interest point category prediction can effectively help interest point prediction and achieve mutual promotion. Therefore, while predicting interest points, a corresponding category classifier is also designed and the loss function is adjusted to guide the model to learn the association between interest points and their categories in the embedded information.
[0109] Example
[0110] This embodiment provides an interest point recommendation method, the algorithm framework of which is as follows: Figure 1 As shown.
[0111] The process of training its interest point recommendation model includes the following steps:
[0112] S1. Constructing the training set
[0113] In this embodiment, the check-in data includes check-in user tags and check-in point of interest (POI) information. The POI information includes POI tags, location information, category information, and check-in time; the POI category information includes category tags. The introduction of category information helps enrich the expression of user preferences and enables the prediction of POI categories. The specific content of the POI information can be selected according to the actual situation; for example, if only POIs are to be predicted, only location information and check-in time need to be included.
[0114] Then, based on the check-in user information, the interest point information of each user is extracted from the check-in data and arranged according to the timeline to construct the historical trajectory of each user. The historical trajectory of each user is divided according to a preset time interval to obtain a set of training trajectories for each user. For each training trajectory, the last interest point arranged chronologically is taken as the actual check-in, and the trajectory composed of the remaining interest points excluding the actual check-in constitutes the current trajectory. Training samples are constructed based on each current trajectory. The training samples include the current trajectory, the actual check-ins belonging to the same training trajectory as the current trajectory, and the historical trajectories to which the current trajectory belongs. A training set is constructed based on the training samples. In this embodiment, the time interval for dividing the historical trajectory is set to a natural day, that is, the trajectory of one day constitutes one training trajectory.
[0115] S2, Constructing the encoding matrix
[0116] In this step, based on the data from step S1, an interest point embedding matrix, a category encoding embedding matrix, and a time encoding embedding matrix are constructed respectively.
[0117] The pre-training of the interest point embedding matrix includes:
[0118] C1. Data Preparation
[0119] Obtain the check-in data mentioned in step S1, construct an interest point set based on the interest point tags contained therein; construct and initialize an interest point embedding matrix, wherein the elements of the interest point embedding matrix correspond one-to-one with the interest points in the interest point set.
[0120] C2. Input an interest point p from the set of interest points. i , which serves as the current anchor point.
[0121] C3. Extract the current anchor point p i Same category c k The points of interest constitute the current anchor point p. i The set of positive samples D cp (c k From the set of points of interest, for the current anchor point p i Next point of interest p i+1 and the positive sample set D cp (c k Sampling is performed on other points of interest besides those already included, to construct the current anchor point p. i The set of negative samples, the next point of interest p i+1 For the current anchor point p ii The trajectory belongs to the current anchor point p along the timeline. iThe next point of interest; that is, the points of interest in the negative sample set of the current anchor point are other points of interest in the set of points of interest that have different activity categories from the current anchor point and are not the next point of interest.
[0122] C4. Using the interest point embedding matrix, based on the mapping relationship between interest points and the interest point embedding matrix, obtain the anchor points and the embedding representations of each interest point in the positive and negative sample sets.
[0123] C5. Using the embedding representation of interest points obtained in step C4, perform relation distillation by comparing and learning between the anchor point and the interest points contained in the positive sample set and between the anchor point and the interest points contained in the negative sample set, and update the interest point embedding matrix.
[0124] C6. Repeat steps C2 to C5 until all interest points in the interest point set have been traversed, and the interest point embedding matrix is obtained.
[0125] To facilitate the extraction of the positive sample set in step C3, we iterate through the interest points in the interest point set and construct an interest point category dictionary D based on the interest point category labels. cp The dictionary is represented in key-value pairs, such as: Category ID:S cp , among which, S cp This represents all points of interest that share the same category label.
[0126] The purpose of pre-training is to maximize the distance between the positive and negative sample clusters based on the loss. Therefore, any existing method can be used. Specifically, in this embodiment, using the embedding representation of interest points obtained in step C4, the interest point embedding matrix is updated by comparing and learning between the anchor point and the interest points contained in the positive sample set, and between the anchor point and the interest points contained in the negative sample set, according to the following formula. Relationship distillation is performed based on minimizing the expectation:
[0127]
[0128] in, Let s(·) represent minimizing the expectation, where P is the set of interest points, and s(·) represents the similarity calculation. i p is the current anchor point. i+1 For the current anchor point p i The trajectory belongs to the current anchor point p along the timeline. i The next point of interest, p r To obtain from the positive sample set D cp (c k A random value obtained from the current anchor point p) i Points of interest of the same category, p j Let v(p) be the j-th negative sample, and J represent the number of interest points sampled from the negative sample set; i ), v(pj ), v(p i+1 ) and v(p r ) represent p respectively i p j p i+1 and p r Embedded representation.
[0129] Because this embodiment introduces rich interest point information and adopts the above-described method, using contrastive learning and relation distillation to obtain the interest point embedding matrix through pre-training, it is able to fully extract the feature information of the interest points.
[0130] The category encoding embedding matrix is obtained by calculating the statistical frequency of each category using the categories of each interest point in the interest point set, and then calculating the category encoding embedding matrix based on the statistical frequency of the categories:
[0131] The distribution of all points of interest in each category is statistically analyzed to obtain the statistical frequency of each category.
[0132] A category-coded one-hot matrix is established, wherein the row and column dimensions of the category-coded one-hot matrix are the number of interest points and the number of categories in the interest point set, respectively, and the value of each element of the category-coded one-hot matrix is the statistical frequency of the category to which the corresponding interest point belongs; then, using the category-coded one-hot matrix, a category-coded embedding matrix is obtained through a fourth coding network.
[0133] The time-coding embedding matrix is obtained by calculating the statistical frequency of each time period using the check-in time of each interest point in the interest point set, and then calculating the time-coding embedding matrix based on the statistical frequency of the time periods:
[0134] The time interval for dividing the training trajectory in step S1 is further subdivided into time periods. The distribution of all interest points in the interest point set in each time period is statistically analyzed to obtain the statistical frequency of each time period. In this step, the natural day is subdivided into 24 time periods by hour.
[0135] A time-coded one-hot matrix is established, wherein the row and column dimensions of the time-coded one-hot matrix are the number of interest points and the number of time periods in the interest point set, respectively, and the value of each element of the time-coded one-hot matrix is the statistical frequency of the time period to which the corresponding interest point belongs; using the time-coded one-hot matrix, a time-coded embedding matrix is obtained through a fifth coding network.
[0136] The fourth and fifth encoding networks can be implemented using existing methods, such as fully connected networks. In this embodiment, both the fourth and fifth encoding networks employ linear transformations for encoding.
[0137] Using the following formula, the category-coded one-hot matrix A cAnd time-encoded one-hot matrix A t Through linear transformation, the category encoding embedding matrix V is obtained. c and time-coded embedding matrix V t :
[0138] V c =Tanh(A c W vc )
[0139] V t =Tanh(A t W vt )
[0140] Where Tanh represents the activation function, W vc and W vt These are the parameters of the linear transformation.
[0141] S3, Point of Interest Coding
[0142] In this step, firstly, each interest point contained in the historical trajectory of the input training sample is encoded to obtain the embedding representation of each interest point, including:
[0143] S31. Input the points of interest contained in the historical trajectory of the training sample;
[0144] S32. Based on the interest point information, using the interest point embedding matrix, i.e. the first coding network, and based on the mapping relationship between interest points and the interest point embedding matrix, obtain the embedding representation of each input interest point; using the category coding embedding matrix, i.e. the second coding network, and based on the category information of the interest points, obtain the category embedding representation of the input interest points; using the time coding embedding matrix, i.e. the third coding network, and based on the check-in time of the interest points, obtain the time embedding representation of the input interest points.
[0145] S33. By aggregating the initial embedding representation of the input interest point, its category embedding representation and temporal embedding representation are fused to obtain the final embedding representation of the input interest point.
[0146] In this embodiment, the aggregation method is a frequency-gated network; through the frequency-gated network, the input interest point p is aggregated according to the following formula. τ The initial embedding representation v(p) τ ), and fuse its category embedding representation v c (p τ ) and temporal embedding representation v t (p τ ), to obtain the final embedded representation v′(p) of the input interest point. τ ):
[0147] v′(p τ )=g(τ)p E mm (v(p τ ))+g(τ) c,t E gen (v c (p τ )+v t (p τ ))
[0148] g(τ) p =Sigmoid(W g *τ freq )
[0149] g(τ) c,t =1-g(τ) p
[0150] Among them, E mm Represents a memory network, E gen This represents a generalization network, where both the memory network and the generalization network are feedforward neural networks with the ELU activation function added; g(τ) p E mm (v(p τ )) represents the initial embedding representation v(p) τ The output of the frequency-gated network, g(τ) c,t E gen (v c (p τ )+v t (p τ )) represents the category embedding representation of points of interest v c (p τ ) and temporal embedding representation v t (p τ The output of the frequency-gated network; τ freq W represents the statistical frequency of the point of interest in the set of points of interest. g This represents the characteristic transformation matrix.
[0151] After obtaining the embedding representation of each interest point, in order to ensure the subsequent attention calculation, it is necessary to add a position encoding vector to the embedding representation of each interest point according to the order of their check-in time, so as to obtain the feature representation of each interest point.
[0152] In this embodiment, firstly, based on the order of check-in times for each point of interest, its location code PE is obtained using an absolute location encoding method. τ The embedding representation of each point of interest is given by the following formula: v′(p τ Add location encoding PE τ Obtain the feature representation v″(p) of each interest point. τ ):
[0153] v″(p τ )=v′(p τ )+PE τ
[0154] Where τ represents the position number of the point of interest in the trajectory according to its check-in time.
[0155] S4, Learning Short-Term Preferences
[0156] In this step, the last point of interest in the current trajectory over its timeline is used as the prediction reference point; the feature representation of each point of interest contained in the current trajectory of the input training sample is used as input, and self-attention is calculated for each point of interest contained therein. Based on the self-attention score of the prediction reference point, the short-term activity hidden state of the training sample is obtained.
[0157] Specifically, firstly, using the feature representations of each interest point contained in the current trajectory of the input training sample as input, self-attention is calculated for each interest point contained therein, according to the following formula:
[0158]
[0159] Where Softmax represents the Softmax function, T represents the matrix transpose, and d k S is the output dimension of the attention head. (h) Q represents the attention head score of the h-th head; (h) K (h) and V (h) These represent the Query value, Key value, and Value value obtained using the transformation matrix of the h-th head, respectively.
[0160] Then, calculate the self-attention score S for each attention head using the following formula. (h) The data is then fused and normalized to obtain the short-term activity representation S of the training samples. b :
[0161] S b =LayerNorm([S (1) ,S (2) ,…,S (h) …,S (H) W S +b S )
[0162] Where LayerNorm represents layer normalization, H represents the number of attention heads in multi-head self-attention, and W... s and b S , where represents the trainable parameters of the fully connected network that fuses the outputs of H attention heads, and b represents the index of the training sample; the final short-term activity representation S with contextual information is obtained.b .
[0163] Subsequently, S represents the short-term activity obtained. b Perform average pooling to obtain the short-lived activity hidden state.
[0164] S5, Long-term Learning Preferences
[0165] In this step, the feature representations of each interest point contained in the historical trajectory of the input training sample are concatenated to form the feature matrix of the historical trajectory; using the feature matrix of the historical trajectory and the short-term activity hidden state of the training sample, the long-term preference tensor of the training sample is obtained based on the cross-attention mechanism.
[0166] Specifically, firstly, a feature matrix L is constructed using the feature representations of each interest point contained in the historical trajectories of the input training samples; then, the feature matrix L of the historical trajectories and the short-term activity hidden states of the training samples are used... Cross-attention is calculated using the following formula:
[0167] z = Softmax(eW) a +b z (LU) l +b u )
[0168]
[0169] Among them, W s W l W a U l b z b u and b a All are learnable parameters; Tanh represents the activation function; Softmax represents the Softmax function;
[0170] Then, the output z of the cross-attention mechanism, after normalization, is compared with the short-term activity hidden state. Perform residual connections to obtain the long-term preference tensor.
[0171]
[0172] Where LayerNorm represents layer normalization, and b represents the sequence number of the training sample.
[0173] S6, Point of Interest Prediction
[0174] In this step, based on the short-term activity hidden state and long-term preference tensor of the input training samples, the next point of interest is predicted using an inference network.
[0175] Inference networks can employ any existing method, such as traditional machine learning models like vector machines, decision trees, and random forests.
[0176] Furthermore, the inference network includes an interest point classifier and a category classifier, both of which are composed of fully connected networks;
[0177] Short-term activity hidden state based on input training samples and long-term preference tensor Using the following formula, predict the next point of interest using an inference network;
[0178]
[0179] in, Let be the probability distribution vector of the predicted (n+1)th point of interest across all points of interest. W represents the probability distribution vector of the predicted (n+1)th point of interest across all categories. p W c b p and b c These represent the trainable parameters, and Softmax represents the Softmax function.
[0180] In this embodiment, the inference network includes an interest point classifier and a category classifier, both of which are composed of fully connected networks. At the same time, a proximity matrix is introduced, using the geographical distance of the interest point as a threshold to filter out some unreasonable prediction points, effectively improving the classification performance of the model.
[0181] Specifically, based on the short-term activity hidden state of the input training samples and long-term preference tensor Using the following formula, predict the next point of interest using an inference network;
[0182]
[0183] in, Let be the probability distribution vector of the predicted (n+1)th point of interest across all points of interest. W represents the probability distribution vector of the predicted (n+1)th point of interest across all categories. p W c b p and b c V represents the trainable parameters, Softmax represents the Softmax function; near This is a matrix of neighboring locations.
[0184] The nearest location matrix V nearThe dimension is B×N, where B represents the number of training samples in this round of training input, and N represents the number of interest points in the interest point set. The interest point set is the set composed of all interest points in the check-in data described in step A1. For the current trajectory of each training sample in this round of training input, the last interest point in its timeline arrangement is extracted as its prediction reference point. The distance between each interest point in the interest point set and each prediction reference point is calculated. If the distance meets the distance threshold, then in V near The corresponding element in the table is assigned the value α, otherwise it is assigned the value 1; α is a preset coefficient and α>1. In this embodiment, the distance threshold is 1km, calculated by the latitude and longitude between points of interest.
[0185] S7, Update model parameters
[0186] In this step, based on the predicted interest points and actual check-ins of each training sample in this round of training, the cross-entropy loss is calculated, and the model parameters are updated using gradient descent based on the cross-entropy loss.
[0187] Since category prediction was performed, the cross-entropy loss is calculated using the following formula:
[0188]
[0189] Among them, L b The cross-entropy loss is the value of the b-th training sample, where L is the total loss for this training round, and p is the cross-entropy loss. n+1 For the interest point labels of the actual check-ins of the b-th training sample, Let c be the probability distribution vector of the (n+1)th interest point predicted from the b-th training sample across all interest points. n+1 Let be the category label of the actual check-in for the b-th training sample. This is the probability distribution vector of the (n+1)th interest point predicted for the b-th training sample across all categories. β is a preset coefficient; by setting the parameter β, the training directions of category prediction and interest point prediction can be aligned.
[0190] S8, Iterative Training
[0191] By repeating steps S3-S7 until the training termination condition is met, the trained interest point recommendation model is obtained.
[0192] Based on the above process, we can obtain the trained interest point recommendation model. In practical application scenarios, we can construct the historical trajectory of the user to be recommended using all the check-in data of the user to be recommended; construct the current trajectory of the user to be recommended using the check-in data contained in the last time interval of the user to be recommended according to the preset time interval; and then, using the historical trajectory and the current trajectory as input, we can use the trained interest point recommendation model to output the next interest point.
[0193] Experimental verification:
[0194] Eight other common models in existing technologies were selected as comparative experiments. The performance of the interest point recommendation model of this invention was evaluated on two real-world trajectory datasets, and the results are shown in Table 1. The two real-world trajectory datasets are the New York City dataset (hereinafter referred to as NYC) and the Tokyo dataset from Foursquare. For different models, the data was processed differently according to their input interface requirements to ensure that the models functioned correctly.
[0195] In the table, ACC@K represents the accuracy of the recommendation model. It is calculated as the proportion of the number of target values among the first K predicted output values of the recommendation model divided by the total number of values. The larger the ACC@K, the higher the accuracy of the model. In this experiment, K=1 and 5 were selected, i.e., ACC@1 and ACC@5. AUC is the area under the receiver operating characteristic (ROC) curve, a commonly used indicator in classification models. Its value is usually between (0.5-1). The larger the AUC value, the better the classifier's performance. MAP is the mean accuracy, also a commonly used indicator in recommendation models. However, this indicator reflects the average level of the recommendation model more comprehensively. It can be considered in conjunction with the model's prediction accuracy. Again, the larger the MAP value, the better the model's performance.
[0196] Table 1: Performance comparison of the embodiment model and the existing technology model on two datasets.
[0197]
[0198] In Table 1, Ours represents the point-of-interest recommendation model of this invention, while GRU, ST-RNN, HST-LSTM, DeepMove, VANext, MobTCast, CFPRec, and SSDL are eight common recommendation models in the prior art. As can be seen from Table 1, the model in this embodiment achieves improvements in all metrics compared to other models on both datasets.
[0199] Furthermore, using the model from this embodiment of the invention, we randomly selected some trajectory data on the New York City dataset for testing. We recorded the sequence of interest points, category points, predicted interest points, actual interest points, and the frequency of occurrence of predicted and actual interest points in the training set / test set / user, to verify whether the model can predict low-frequency points and whether it has the ability to predict based on category. The experimental results are shown in Table 2.
[0200] Table 2. Random case test results of the example model on the New York City dataset.
[0201]
[0202] As shown in Table 2, the model of this embodiment achieved accurate results for three users, numbered 89, 101, and 885. However, we also need to pay attention to two scenarios, such as users 58 and 791. In these cases, the interest point categories were accurately predicted, but the actual location points were missed. The common point in these two cases is that the user's preferred points were selected. For example, for user 58, the interest point categories were two points in Light Rail. The user visited the interest point numbered 10380 66 times, but only 14 times the interest point numbered 11896. Similarly, for user 791, the interest point numbered 21988 was also visited more frequently. This demonstrates that this invention can focus on users' long-term preferences and shows its guiding role in homogeneous activities.
[0203] However, due to the complexity and variability of human behavior, it is difficult to completely capture all instances, and there will always be some other situations. Therefore, the method of this invention cannot be perfect. For example, in the last case in Table 2, the interest point category predicted by the model of this invention is inconsistent with the actual category, and the predicted interest point also deviates from the actual interest point. This may be because the model ignores the distance home and mode of transportation.
[0204] However, the above experiments demonstrate that the point of interest recommendation model in this invention outperforms other recommendation models in the prior art in terms of overall performance.
[0205] Finally, it should be noted that the above embodiments are merely preferred embodiments and are not intended to limit the present invention. It should be pointed out that those skilled in the art can make various modifications, equivalent substitutions, and improvements without departing from the spirit and scope of the claims, and all such modifications, substitutions, and improvements should be included within the scope of protection of the present invention.
Claims
1. An interest point recommendation method, characterized in that, Includes the following steps: A. Training the interest point recommendation model A1. Constructing the training set Obtain check-in data, which includes check-in user tags and check-in point of interest information, including point of interest tags, location information of the point of interest, and check-in time; Based on the check-in user tags, the interest information of each user is extracted from the check-in data and arranged according to the timeline to construct the historical trajectory of each user; the historical trajectory of each user is divided according to the preset time interval to obtain a set of training trajectories for each user. For each training trajectory, the last point of interest arranged in timeline is taken as the real check-in, and the trajectory composed of the remaining points of interest excluding the real check-in is the current trajectory. Training samples are constructed based on each current trajectory. The training samples include the current trajectory, real check-ins belonging to the same training trajectory as the current trajectory, and the historical trajectories to which the training trajectory to which the current trajectory belongs belong. Construct a training set based on training samples; A2. Extract at least one training sample from the training set as the input for this round of training; process each input training sample according to the following steps: A21. Encode each point of interest contained in the historical trajectory of the input training sample to obtain the embedding representation of each point of interest; add a position encoding vector to the embedding representation of each point of interest according to the order of the check-in time of each point of interest to obtain the feature representation of each point of interest. A22. Using the feature representations of each interest point contained in the current trajectory of the input training sample as input, perform self-attention calculation on each interest point contained therein, and obtain the short-term activity hidden state of the training sample based on the self-attention score. A23. Using the feature representations of each interest point contained in the historical trajectory of the input training sample, concatenate them to form the feature matrix of the historical trajectory; using the feature matrix of the historical trajectory and the short-term activity hidden state of the training sample, obtain the long-term preference tensor of the training sample based on the cross-attention mechanism. A24. Based on the short-term activity hidden state and long-term preference tensor of the input training samples, use an inference network to predict the next point of interest. A3. Based on the predicted interest points and actual check-ins of each training sample in this round of training, calculate the cross-entropy loss, and update the model parameters using gradient descent according to the cross-entropy loss. A4. Repeat steps A2-A3 until the training termination condition is met to obtain the trained interest point recommendation model. B. Perform the recommended task: Using all the check-in data of the user to be recommended, construct their historical trajectory; according to the preset time interval, using the check-in data of the user to be recommended according to the last time interval of the timeline, construct their current trajectory; then, using the historical trajectory and the current trajectory as input, use the trained interest point recommendation model to output the next interest point.
2. The point-of-interest recommendation method as described in claim 1, characterized in that: In step A24, the inference network includes an interest point classifier composed of a fully connected network: based on the short-term activity hidden state of the input training samples. and long-term preference tensor Using an interest point classifier, predict the next interest point according to the following formula: in, Let W be the probability distribution vector of the predicted (n+1)th point of interest across all points of interest, where b represents the index of the training sample; p and b p V represents the trainable parameters of the fully connected network that constitutes the interest point classifier, and Softmax represents the Softmax function; near This is a matrix of neighboring locations; The nearest location matrix V near The dimension is B×N, where B represents the number of training samples in this round of training input, and N represents the number of interest points in the interest point set. The interest point set is the set composed of all interest points in the check-in data described in step A1. For the current trajectory of each training sample in this round of training input, the last interest point in its timeline arrangement is extracted as its prediction reference point. The distance between each interest point in the interest point set and each prediction reference point is calculated. If the distance meets the distance threshold, then in V near The corresponding element in the table is assigned the value α, otherwise it is assigned the value 1; α is a preset coefficient and α>1.
3. The point-of-interest recommendation method as described in claim 1, characterized in that, The check-in data includes check-in user tags and check-in point of interest information. The point of interest information includes point of interest tags, as well as the location information, category information, and check-in time of the point of interest. The category information of the point of interest includes category tags. In step A21, each interest point contained in the historical trajectory of the input training sample is encoded to obtain the embedding representation of each interest point, specifically including: A211. Input the points of interest contained in the historical trajectory of the training samples; A212. Based on the interest point information, the first coding network is used to obtain the initial embedding representation of the input interest point; the second coding network is used to obtain the category embedding representation of the input interest point; and the third coding network is used to obtain the temporal embedding representation of the input interest point. A213. By aggregating the initial embedding representation of the input interest point, its category embedding representation and temporal embedding representation are fused to obtain the final embedding representation of the input interest point.
4. The point-of-interest recommendation method as described in claim 3, characterized in that, The input is the points of interest contained in the historical trajectory of the input training sample. The first coding network uses an interest point embedding matrix to obtain the embedding representation of each input interest point based on the mapping relationship between interest points and the interest point embedding matrix; The second encoding network uses a category encoding embedding matrix to obtain the category embedding representation of the input interest point based on the category information of the interest point; The third coding network uses a time coding embedding matrix to obtain the time embedding representation of the input interest point based on the check-in time of the interest point; The interest point embedding matrix corresponds one-to-one with the interest points in the interest point set, and is obtained through pre-training using contrastive learning and relation distillation. The interest point set is the set of all interest points in the check-in data described in step A1. The statistical frequency of each category is calculated using the category of each interest point in the interest point set, and the category encoding embedding matrix is calculated based on the statistical frequency of the categories. By utilizing the check-in time of each point of interest in the point of interest set, the statistical frequency of each time period is calculated, and the time-encoded embedding moment is calculated based on the statistical frequency of the time period. The time period is obtained by further subdividing the time interval of the current trajectory in step A1.
5. The point-of-interest recommendation method as described in claim 4, characterized in that: The pre-training of the interest point embedding matrix includes: C1. Data Preparation Obtain the check-in data mentioned in step A1, construct an interest point set based on the interest point tags contained therein; construct and initialize an interest point embedding matrix, wherein the elements of the interest point embedding matrix correspond one-to-one with the interest points in the interest point set. C2. Input an interest point p from the set of interest points. i , as the current anchor point; C3. Extract the current anchor point p i Same category c k The points of interest constitute the current anchor point p. i The set of positive samples D cp (c k From the set of points of interest, for the current anchor point p i Next point of interest p i+1 and the positive sample set D cp (c k Sampling is performed on other points of interest besides those already included, to construct the current anchor point p. i The set of negative samples, the next point of interest p i+1 For the current anchor point p i The trajectory belongs to the current anchor point p along the timeline. i Subsequent points of interest; C4. Using the interest point embedding matrix, based on the mapping relationship between interest points and the interest point embedding matrix, obtain the anchor points and the embedding representations of each interest point in the positive and negative sample sets. C5. Using the embedding representation of interest points obtained in step C4, perform relation distillation by comparing and learning between the anchor point and the interest points contained in the positive sample set and between the anchor point and the interest points contained in the negative sample set, and update the interest point embedding matrix. C6. Repeat steps C2 to C5 until all interest points in the interest point set have been traversed, and the interest point embedding matrix is obtained.
6. The point-of-interest recommendation method as described in claim 5, characterized in that: In step C5, using the embedding representation of interest points obtained in step C4, the interest point embedding matrix is updated by comparing and learning between the anchor point and the interest points contained in the positive sample set, and between the anchor point and the interest points contained in the negative sample set, according to the following formula. Relationship distillation is performed based on minimizing the expectation: in, Let s(·) represent minimizing the expectation, where P is the set of interest points, and s(·) represents the similarity calculation. i p is the current anchor point. i+1 For the current anchor point p i The trajectory belongs to the current anchor point p along the timeline. i The next point of interest, p r To obtain from the positive sample set D cp (c k A random value obtained from the current anchor point p. i Points of interest of the same category, p j Let v(p) be the j-th negative sample, and J represent the number of interest points sampled from the negative sample set; i ), v(p j ), v(p i+1 ) and v(p r ) represent p respectively i p j p i+1 and p r Embedded representation.
7. The point-of-interest recommendation method as described in claim 4, characterized in that: The category encoding embedding matrix is obtained by the following steps: The distribution of all interest points in the interest point set across all categories is statistically analyzed to obtain the statistical frequency of each category; a category-coded one-hot matrix is established, wherein the row and column dimensions of the category-coded one-hot matrix are the number of interest points and the number of categories in the interest point set, respectively, and the value of each element of the category-coded one-hot matrix is the statistical frequency of the category to which the corresponding interest point belongs; Then, using the category-encoded one-hot matrix, the category-encoded embedding matrix is obtained through the fourth encoding network; The time-encoded embedding matrix is obtained through the following steps: The time interval of dividing the training trajectory in step A1 is subdivided into time periods. The distribution of all interest points in the interest point set in each time period is statistically analyzed to obtain the statistical frequency of each time period. A time-coded one-hot matrix is established, wherein the row and column dimensions of the time-coded one-hot matrix are the number of interest points in the interest point set and the number of time periods, respectively. The value of each element of the time-coded one-hot matrix is the statistical frequency of the time period to which the corresponding interest point belongs. Using the time-coded one-hot matrix, the time-coded embedding matrix is obtained through the fifth coding network.
8. The point-of-interest recommendation method as described in claim 7, characterized in that, Both the fourth and fifth coding networks employ linear transformations for encoding. Using the following formula, the category-coded one-hot matrix A c And time-encoded one-hot matrix A t Through linear transformation, the category encoding embedding matrix V is obtained. c and time-coded embedding matrix V t : V c = Tanh(A c W vc ) V t = Tanh(A t W vt ) Where Tanh represents the activation function, W vc and W vt These are the parameters of the linear transformation.
9. The point-of-interest recommendation method as described in any one of claims 3 to 8, characterized in that, The aggregation network is a frequency-gated network; in step A213, the input interest point p is processed through the frequency-gated network according to the following formula. τ The initial embedding representation v(p) τ ), and fuse its category embedding representation v c (p τ ) and temporal embedding representation v t (p τ ), to obtain the final embedding representation v′(p) of the input interest point. τ ): v′(p τ )=g(τ) p AND mm (v(p τ ))+g(τ) c,t AND gen (v c (p τ )+v t (p τ )) g(τ) p =Sigmoid(W g *t freq ) g(τ) c,t =1-g(τ) p Among them, E mm Represents a memory network, E gen This represents a generalization network, where both the memory network and the generalization network are feedforward neural networks with the ELU activation function added; g(τ) p E mm (v(p τ )) represents the initial embedding representation v(p) τ The output of the frequency-gated network, g(τ) c,t E gen (v c (p τ )+v t (p τ )) represents the category embedding representation of points of interest v c (p τ ) and temporal embedding representation v t (p τ The output of the frequency-gated network; τ freq W represents the statistical frequency of the point of interest in the set of points of interest. g This represents the characteristic transformation matrix.
10. The point-of-interest recommendation method as described in any one of claims 1 to 8, characterized in that, In step A21, firstly, based on the order of check-in times for each point of interest, the location code PE is obtained using the absolute location coding method. τ The embedding representation of each point of interest is given by the following formula: v′(p τ Add location encoding PE τ Obtain the feature representation v″(p) of each interest point. τ ): v″(p τ )=v′(p τ )+PE τ Where τ represents the position number of the point of interest in the trajectory according to its check-in time.
11. The point-of-interest recommendation method as described in any one of claims 1 to 8, characterized in that, In step A22, self-attention is calculated for each interest point contained in the current trajectory of the input training sample, using the feature representations of each interest point as input, according to the following formula: Where Softmax represents the Softmax function, T represents the matrix transpose, and d k S is the output dimension of the attention head. (h) Q represents the attention head score of the h-th head; (h) K (h ) and V (h) These represent the Query value, Key value, and Value value obtained using the transformation matrix of the h-th head, respectively. Then, calculate the self-attention score S for each attention head according to the following formula. (h) The data is then fused and normalized to obtain the short-term activity representation S of the training samples. b : S b =LayerNorm([S (1) ,S (2) ,...,S (h) …,S (H) ]W S +b S ) Where LayerNorm represents layer normalization, H represents the number of attention heads in multi-head self-attention, and W... s and b S , where are the trainable parameters of the fully connected network that fuses the outputs of H attention heads, and b represents the sequence number of the training sample; Subsequently, S represents the short-term activity obtained. b Perform average pooling to obtain the short-lived activity hidden state.
12. The point-of-interest recommendation method as described in any one of claims 1 to 8, characterized in that, In step A23, a feature matrix L is constructed using the feature representations of each interest point contained in the historical trajectory of the input training sample; the feature matrix L of the historical trajectory and the short-term activity hidden state of the training sample are then used. Cross-attention is calculated using the following formula: z=Softmax(eW a +b z )(IN l +b u ) Among them, W s W l W a U l b z b u and b a All are learnable parameters; Tanh represents the activation function; Softmax represents the Softmax function; Then, the output z of the cross-attention mechanism, after normalization, is compared with the short-term activity hidden state. Perform residual connections to obtain the long-term preference tensor. Where LayerNorm represents layer normalization, and b represents the sequence number of the training sample.
13. The point-of-interest recommendation method as described in any one of claims 5 to 8, characterized in that, In step A24, the inference network further includes a category classifier composed of a fully connected network; and short-term activity hidden states based on the input training samples. and long-term preference tensor Using an interest point classifier, predict the category of the next interest point according to the following formula: in, W represents the probability distribution vector of the predicted (n+1)th point of interest across all categories. c and b c These represent the trainable parameters, and Softmax represents the Softmax function.
14. The point-of-interest recommendation method as described in claim 13, characterized in that, In step A3, the cross-entropy loss is calculated using the following formula: Among them, L b p is the cross-entropy loss of the b-th training sample, L is the total loss of this training round, and p n+1 For the interest point labels of the actual check-ins of the b-th training sample, Let c be the probability distribution vector of the (n+1)th interest point predicted from the b-th training sample across all interest points. n+1 Let be the category label of the actual check-in for the b-th training sample. Let β be the probability distribution vector of the (n+1)th interest point predicted from the b-th training sample in each category, where β is a preset coefficient.