Interest point recommendation method

By combining the self-attention and cross-attention mechanisms, the interest point recommendation model solves the problems of short-term and long-term interest consistency and personalized recommendation, improves the accuracy and personalized ability of interest point prediction, and is suitable for multiple application scenarios. .

CN118747239AActive Publication Date: 2024-10-08SOUTHWESTERN UNIV OF FINANCE & ECONOMICS +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410745586.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-11
Publication Date
2024-10-08
Estimated Expiration
2044-06-11

AI Technical Summary

Technical Problem

Existing point-of-interest recommendation systems are difficult to maintain consistency between short-term interests and long-term interests, resulting in insufficient recommendation accuracy, and traditional methods are difficult to effectively capture users' personalized preferences and geographical location relationships.

Method used

Adopting an interest point recommendation method, by training the interest point recommendation model, using check-in data to construct the user's historical trajectory and current trajectory, combining the self-attention mechanism and the cross-attention mechanism, learning the user's short-term and long-term preferences, and predicting the next interest points, and improve model expression capabilities through pre-trained interest point embedding matrices and category information.

Benefits of technology

It improves the prediction accuracy of the user's next point of interest, enhances the model's personalized recommendation capabilities, and is suitable for areas such as location services and intelligent traffic management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118747239A_ABST
    Figure CN118747239A_ABST
Patent Text Reader

Abstract

The invention relates to an interest point recommendation technology, and discloses an interest point recommendation method, which comprises the following steps of: respectively constructing a historical track and a current track of a user, taking feature representation of each interest point contained in the current track as input, performing self-attention calculation on each interest point contained in the current track, and obtaining a short-term activity hidden state based on a self-attention score; constructing a characteristic matrix of the historical track by using the characteristic representation of each interest point contained in the historical track; obtaining a long-term preference tensor based on a cross attention mechanism by using a short-term activity hidden state and a characteristic matrix of a historical track; and predicting the next interest point based on the short-term activity hiding state and the long-term preference tensor. The consistency of long and short term preferences is ensured, the expression ability of the user preferences is improved, and the prediction accuracy of the next interest point of the user is improved. The method has good practicability in the fields of location service, intelligent traffic management, social media recommendation and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a point of interest recommendation technology, and in particular to a point of interest recommendation method. Background Art

[0002] The collection of trajectory data has become common due to their increasing applications in multiple fields. For example, mobile devices, cars, logistics transportation systems, and GPS trackers can generate trajectory data. These data usually contain time and location information, forming the trajectory of users, vehicles, or objects. The analysis of trajectory data is crucial for understanding user behavior, traffic flow management, route planning, and location services.

[0003] When processing trajectory data, POI (Point of interest) is an important part of trajectory data. It generally refers to a specific point or location in a map or geographic area that has special interest or value.

[0004] Generally speaking, POI contains the following information:

[0005] Name: The name of the POI, such as the name of a store, restaurant, or attraction.

[0006] Geographical Coordinates: The precise geographic location of a POI, usually expressed in longitude and latitude, which is key 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 a POI so that users know when they can visit.

[0009] Other descriptive information about the POI, such as contact information, pictures, and special services or facilities.

[0010] This information is usually stored in a geographic information database or map service in the form of structured data so that users can easily search, browse and obtain information related to POIs. This data is very useful for navigation, travel planning, location search and geographic analysis.

[0011] In the real world, there are many scenarios where the next POI recommendation problem exists, such as predicting the end point of a trajectory, which helps navigation applications and path planning, and identifying abnormal behaviors in trajectories, such as traffic accidents or emergencies. The human mobility problem is to build a model to effectively utilize and mine known POIs to predict the next POI for humans.

[0012] In the existing point-of-interest recommendation systems, traditional recommendation methods are mainly based on pattern or data-driven methods, such as Markov chains and matrix decomposition [Where you like to go next: Successful point-of-interest recommendation,” in Proceedings of the Twenty-Third International Joint Conference on Artificial Intelligence, ser. IJCAI13. AAAIPress, 2013, p. 2605–2611.]; at the same time, collaborative filtering-related methods have also achieved certain results, but still face problems such as data sparsity and cold start.

[0013] In addition, since the relationships between users and points of interest are complex and diverse, and are affected by many factors, such as geographic location, social relationships, time period, etc., traditional point-based recommendation methods often find it difficult to accurately capture these relationships. Therefore, how to effectively represent and model these complex relationships has become the key to improving the performance of recommendation systems.

[0014] With the widespread application of deep learning technology, research related to POI recommendation has also been inspired. Deep recurrent neural networks (RNNs) and their variants LSTM and GRU can capture the dependencies between sequences well and have been widely used. For example, DeepMove [Deepmove: Predicting human mobility with attentionalrecurrent networks,” in Proceedings of the 2018world wide web conference, 2018, pp.1459–1468] uses recurrent neural networks to learn short-term and long-term preferences of human mobility, and then combines the two to improve accuracy.

[0015] Although the RNN family performs amazingly in sequence learning, it is difficult to use in longer sequences due to its limited computational speed. Therefore, the attention mechanism has received widespread attention due to its ability to learn global dependencies. For example, CFPRec [“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 the user’s historical preferences, calculates the distance from the point to the predicted point to classify the POI, and assigns different attention weight values ​​to accurately predict the next user’s preference.

[0016] However, current deep neural network models still face the following key issues in human mobility recommendation:

[0017] First, how to alleviate the problem caused by POI popularity bias in recommendation and improve the information content of the latent space vector of POI representation learning to ensure that the target POI can be more accurately located near the relevant semantic information when recommending it;

[0018] Second, how to learn users’ time-varying preferences and further capture the interdependence between the sequential relationship of POIs and user personalization to enhance the personalized recommendation capability of the model.

[0019] Therefore, we believe that how to maintain consistency between short-term interests and long-term interests and a good classifier are also very important. Summary of the invention

[0020] The technical problem to be solved by the present invention is to propose a method for recommending points of interest, which can maintain the consistency between short-term interests and long-term interests and improve the accuracy of predicting the next point of interest of a user.

[0021] The technical solution adopted by the present invention to solve the above technical problems is:

[0022] A method for recommending points of interest includes the following steps:

[0023] A. Training the POI recommendation model

[0024] A1. Constructing a training set

[0025] Acquire sign-in data, the sign-in data including a sign-in user tag and sign-in point of interest information, the point of interest information including a point of interest tag and location information of the point of interest and a sign-in time;

[0026] Based on the information of the signed-in users, the information of the points of interest of each user is extracted from the sign-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 of each user; for each training trajectory, the last point of interest arranged according to the timeline is taken as the real sign-in, and the trajectory composed of the remaining points of interest except the real sign-in constitutes the current trajectory;

[0027] Constructing training samples based on each current trajectory respectively, wherein the training samples include the current trajectory, the real check-in 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; constructing a training set 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. For each input training sample, process it according to the following steps:

[0029] A21. Encode each point of interest contained in the historical trajectory of the input training sample to obtain an embedded representation of each point of interest; add a position encoding vector to the embedded representation of each point of interest according to the order of the check-in time of each point of interest to obtain a feature representation of each point of interest;

[0030] A22, taking the feature representation of each interest point contained in the current trajectory of the input training sample as input, performing self-attention calculation on each interest point contained therein, and obtaining the short-term active hidden state of the training sample based on the self-attention score;

[0031] A23. The feature representation of each interest point contained in the historical trajectory of the input training sample is concatenated to form a feature matrix of the historical trajectory; the long-term preference tensor of the training sample is obtained based on the cross-attention mechanism using the feature matrix of the historical trajectory and the short-term active hidden state of the training sample;

[0032] A24, based on the short-term active hidden state and long-term preference tensor of the input training sample, use the inference network to predict the next point of interest;

[0033] A3. Based on the predicted points of interest and actual check-ins of each training sample input in this round of training, calculate the cross entropy loss, and use gradient descent to update the model parameters according to the cross entropy loss;

[0034] A4, looping steps A2-A3 until the training termination condition is reached, and obtaining a trained POI recommendation model;

[0035] B. Perform recommended tasks:

[0036] The historical trajectory of the user to be recommended is constructed with all the check-in data. The current trajectory of the user to be recommended is constructed with the check-in data contained in the last time interval of the timeline at the preset time interval. Then, the historical trajectory and the current trajectory are used as input, and the trained POI recommendation model is used to output the next POI.

[0037] Furthermore, in step A24, the inference network includes an interest point classifier composed of a fully connected network: based on the short-term active hidden state of the input training sample and the long-term preference tensor Using the POI classifier, predict the next POI according to the following formula:

[0038]

[0039] in, is the probability distribution vector of the predicted n+1th interest point at each interest point, b represents the sequence number of the training sample; W p and b p They represent the trainable parameters of the fully connected network of the interest point classifier, Softmax represents the Softmax function; V near is the neighboring position matrix;

[0040] The neighboring position matrix V near The dimension is B×N, where B represents the number of training samples input in this round of training, and N represents the number of interest points in the interest point set, and the interest point set is a set of all interest points in the check-in data in step A1; for the current trajectory of each training sample input in this round of training, the last interest point arranged in its timeline is extracted as its prediction reference point, and 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 is assigned a value of α, otherwise it is assigned a value of 1; α is a preset coefficient and α>1.

[0041] Further, the check-in data includes a check-in user tag and check-in point of interest information, the point of interest information includes a point of interest tag and location information, category information and check-in time of the point of interest; the category information of the point of interest includes a category tag;

[0042] In step A21, each interest point included in the historical trajectory of the input training sample is encoded respectively to obtain an embedded representation of each interest point, which specifically includes:

[0043] A211, input each point of interest contained in the historical trajectory of the training sample;

[0044] A212, based on the information of the interest points, using the first encoding network, obtaining an initial embedding representation of the input interest points; using the second encoding network, obtaining a category embedding representation of the input interest points; using the third encoding network, obtaining a time embedding representation of the input interest points;

[0045] A213. By aggregation, the initial embedding representation of the input interest point is fused with its category embedding representation and time embedding representation to obtain the final embedding representation of the input interest point.

[0046] Furthermore, each point of interest included in the historical trajectory of the input training sample is used as input;

[0047] The first encoding network uses the interest point embedding matrix to obtain the embedding representation of each input interest point based on the mapping relationship between the interest point and the interest point embedding matrix; the second encoding network uses the 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 encoding network uses the time encoding embedding matrix to obtain the time embedding representation of the input interest point based on the check-in time of the interest point;

[0048] The interest point embedding matrix corresponds to the interest points in the interest point set one by one, and is obtained through pre-training by contrastive learning and relational distillation. The interest point set is a set of all interest points in the check-in data in step A1; the category of each interest point in the interest point set is used to calculate the statistical frequency of each category, and the category coding embedding matrix is ​​obtained based on the statistical frequency of the category; the check-in time of each interest point in the interest point set is used to calculate the statistical frequency of each time period, and the time coding embedding matrix is ​​obtained based on the statistical frequency of the time period; the time period is obtained by subdividing the time interval for dividing the current trajectory in step A1.

[0049] Furthermore, the pre-training of the interest point embedding matrix includes:

[0050] C1. Data preparation

[0051] Acquire the check-in data described in step A1, and construct an interest point set based on the interest point tags of the interest points contained therein; construct and initialize an interest point embedding matrix, wherein the elements of the interest point embedding matrix correspond one-to-one to the interest points in the interest point set;

[0052] C2. Input an interest point p in the interest point set i , as the current anchor point;

[0053] C3, extract and current anchor point p i Same categoryc k The points of interest constitute the current anchor point p i The positive sample set Dcp (c k ); From the interest point set, the current anchor point p i , next point of interest i+1 And the positive sample set D cp (c k ) other points of interest other than the points of interest included in the sample, and construct the current anchor point p i The negative sample set, the next interest point p i+1 is the current anchor point p i The track is located at the current anchor point p along the timeline i Points of interest afterwards;

[0054] C4, using the interest point embedding matrix, based on the mapping relationship between the interest point and the interest point embedding matrix, obtain the embedding representation of the anchor point and each interest point in the positive sample set and the negative sample set;

[0055] C5, using the embedded representation of the interest point obtained in step C4, using comparative learning between the anchor point and the interest points included in the positive sample set and between the anchor point and the interest points included in the negative sample set, performing relationship distillation, and updating the interest point embedding matrix;

[0056] C6. Loop through steps C2 to C5 until all the interest points in the interest point set are traversed to obtain an interest point embedding matrix.

[0057] Furthermore, in step C5, using the embedded representation of the interest point obtained in step C4, comparative learning is performed between the anchor point and the interest points included in the positive sample set and between the anchor point and the interest points included in the negative sample set, and relationship distillation is performed based on minimization expectation to update the interest point embedding matrix according to the following formula:

[0058]

[0059] in, represents the minimization expectation, P is the set of interest points, s(·) represents the similarity calculation, p i is the current anchor point, p i+1 is the current anchor point p i The track is located at the current anchor point p along the timeline i Points of interest later, p r is the positive sample set D cp (c k ) and the current anchor point p i Points of interest of the same category, p j is the jth negative sample, J represents the number of interest points sampled from the negative sample set; v(p i )、v(p j )、v(p i+1) and v(p r ) represent p i 、p j 、p i+j1 and p r The embedded representation of .

[0060] Furthermore, the category code embedding matrix is ​​obtained by the following steps:

[0061] Counting the distribution of all interest points in the interest point set in each category, and obtaining the statistical frequency of each category; establishing a category coding one-hot matrix, 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, through the fourth coding network, obtaining the category coding embedding matrix;

[0062] The time code embedding matrix is ​​obtained by the following steps:

[0063] The time interval of the training trajectory divided in step A1 is subdivided into time periods, and the distribution of all interest points in the interest point set in each time period is counted to obtain the statistical frequency of each time period; a time coding one-hot matrix is ​​established, and the row and column dimensions of the time coding one-hot matrix are the number of interest points in the interest point set and the number of time periods, respectively, and the value of each element of the time coding one-hot matrix is ​​the statistical frequency of the time period to which the corresponding interest point belongs; using the time coding one-hot matrix, a time coding embedding matrix is ​​obtained through a fifth encoding network.

[0064] Furthermore, the fourth coding network and the fifth coding network both use linear transformation to perform coding;

[0065] According to the following formula, use the category encoding one-hot matrix A c and the time-encoded one-hot matrix A t , through linear transformation, we get the category encoding embedding matrix V c and the temporal encoding embedding matrix V t :

[0066] V c =Tanh(A c W vc )

[0067] V t =Tanh(A t W vt )

[0068] Among them, Tanh represents the activation function, W vc and W vt are the parameters of the linear transformation.

[0069] Furthermore, the aggregation network is a frequency gating network; in step A213, the input interest point p is converted into τ The initial embedding representation v(p τ ), and fuse its category embedding representation v c (p τ ) and the time embedding representation v t (p τ ), and obtain the final embedding representation v′(p τ ):

[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 the memory network, E gen represents the generalization network, and 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 τ ) is the output of the frequency gating network, g(τ) c,t E gen (v c (p τ )+v t (p τ )) represents the category embedding representation v of the interest point c (p τ ) and the time embedding representation v t (p τ ) Output of the frequency gating network; τ freq represents the statistical frequency of the interest point in the interest point set, W g Represents the feature transformation matrix.

[0074] Further, in step A21, first, according to the order of the check-in time of each point of interest, the position code PE is obtained by absolute position coding. τ , according to the following formula, the embedding representation v′(p τ )Add position code PE τ , obtain the feature representation v″(p τ ):

[0075] v″(p τ )=v′(p τ )+PE τ

[0076] Among them, τ represents the position number of the interest point in the trajectory according to its check-in time.

[0077] Furthermore, in step A22, according to the following formula, the feature representation of each interest point contained in the current trajectory of the input training sample is used as input to perform self-attention calculation on each interest point contained therein:

[0078]

[0079] Among them, softmax represents the Softmax function, T represents the matrix transpose, and d k is the output dimension of the attention head, S (h) represents the attention score of the hth head; Q (h) , K (h) and V (h) They are the Query value, Key value and Value value obtained by the transformation matrix of the h-th head using the feature representation;

[0080] Then, the self-attention score S of each attention head is calculated according to the following formula: (h) , fused and normalized to obtain the short-term activity representation S of the training sample b :

[0081] S b =LayerNorm([S (1) ,S (2) ,…,S (h) …,S (H) ]W S +b S )

[0082] Among them, LayerNorm represents layer normalization, H represents the number of attention heads of multi-head self-attention, and W s and b S are the trainable parameters of the fully connected network that fuses the outputs of the H attention heads, and b represents the sequence number of the training sample;

[0083] Afterwards, the obtained short-term activity is expressed as S b , perform average pooling to obtain short-term active hidden states

[0084] Furthermore, in step A23, the feature matrix L of the historical trajectory is constructed by inputting the feature representation of each interest point contained in the historical trajectory of the training sample; the feature matrix L of the historical trajectory and the short-term activity hidden state of the training sample are used According to the following formula, cross attention is calculated:

[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 of the cross attention mechanism z is normalized and compared with the short-term active hidden state Perform residual connection to obtain long-term preference tensor

[0089]

[0090] Among them, 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; a short-term active hidden state based on the input training sample and the long-term preference tensor Using the POI classifier, predict the category of the next POI according to the following formula:

[0092]

[0093] in, is the probability distribution vector of the predicted n+1th interest point in each category, W c and b cThey represent trainable parameters respectively, and Softmax represents the Softmax function.

[0094] Furthermore, in step A3, the cross entropy loss is calculated according to the following formula:

[0095]

[0096] Among them, L b is the cross entropy loss of the bth training sample, L is the total loss of this round of training, and p n+1 is the actual sign-in point of interest label of the b-th training sample, is the probability distribution vector of the n+1th interest point predicted by the bth training sample at each interest point, c n+1 is the category label of the real sign-in of the b-th training sample, is the probability distribution vector of the n+1th interest point predicted by the bth training sample in each category, and β is the preset coefficient.

[0097] The beneficial effects of the present invention are:

[0098] The present invention is a method for recommending points of interest. Compared with the existing technology, in the learning of users' short-term preferences, the multi-head self-attention method is used. Parallel computing brings stronger expression ability to the model, and also improves the computing efficiency so that the model can adapt to the more complex application scenarios at present; for the learning of users' long-term preferences, the long-term preferences are calculated by introducing short-term preferences combined with cross-attention, which ensures the consistency of long-term and short-term preferences, improves the expression ability of user preferences, and thus improves the prediction accuracy of the user's next point of interest. The present invention has good practicality in the fields of location services, intelligent traffic management, social media recommendations, etc. BRIEF DESCRIPTION OF THE DRAWINGS

[0099] Figure 1 Schematic diagram of the algorithm framework of the POI recommendation model in an embodiment of the present invention. DETAILED DESCRIPTION

[0100] User preferences are both cyclical and unique. In order to overcome the limitations of traditional technologies that only focus on short-term preferences, the present invention provides a method for recommending points of interest. Through an attention mechanism, the long-term preferences of users are deeply mined, and combined with short-term preferences, the consistency of long-term and short-term preferences is ensured, thereby improving the expression ability of user preferences.

[0101] In specific implementation, the present invention constructs the historical trajectory and current trajectory of the user respectively, wherein, based on the signed-in user information, the interest point information of each user is extracted from the sign-in data and arranged according to the timeline to construct the historical trajectory of each user, and the historical trajectory can reflect the long-term preference of the user; the current trajectory of the user is constructed based on the sign-in data contained in the last time interval of the timeline, and the current trajectory can reflect the short-term preference of the user, and the time interval can be set as needed, such as: one day.

[0102] Then, the last point of interest in the current trajectory according to its timeline is used as the prediction reference point; the feature representation of each point of interest contained in the current trajectory is used as input, and self-attention calculation is performed on each point of interest contained in it. Based on the self-attention score of the prediction reference point, the short-term activity hidden state is obtained to learn the user's short-term preference. The feature representation of each point of interest contained in the historical trajectory is used to construct the feature matrix of the historical trajectory to represent the user's long-term preference; using the short-term activity hidden state and the feature matrix of the historical trajectory, based on the cross-attention mechanism, the long-term preference tensor is obtained. By introducing short-term preference combined with cross-attention to calculate long-term preference, the consistency of long-term and short-term preferences is guaranteed, and the expression ability of user preferences is improved.

[0103] During the training process, in order to match the historical trajectory with the current trajectory. First, based on the sign-in user information, the interest point information of each user is extracted from the sign-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 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 sign-in, and the trajectory composed of the remaining interest points except the real sign-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, and the training samples include the current trajectory, the real sign-in 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.

[0104] As mentioned above, the core of the present invention lies in the learning of long-term and short-term preferences. Therefore, it can use existing encoding methods to encode interest points, such as Node2Vec based on improved random walk. However, in order to enrich the expression of user preferences, based on the interest point information, the first encoding network is used to obtain the initial embedding representation of the input interest point; the second encoding network is used to obtain the category embedding representation of the input interest point; the third encoding network is used to obtain the time embedding representation of the input interest point; then, through aggregation, the initial embedding representation of the input interest point is fused with its category embedding representation and time embedding representation to obtain the final embedding representation of the input interest point.

[0105] The above-mentioned aggregation may be a weighted sum, splicing, etc. In the present invention, it is further supplemented by a gating mechanism with frequency as input, thereby effectively balancing the popularity preference of points of interest. This can effectively solve the problem of difficulty in making accurate predictions when users come to some relatively niche points of interest.

[0106] In order to better mine the latent vectors of the points of interest and obtain accurate feature information of the points of interest, the present invention also introduces a pre-trained point of interest embedding matrix, which corresponds one-to-one to the points of interest in the point of interest set. The point of interest embedding matrix is ​​used to obtain the embedded representation of each input point of interest based on the mapping relationship between the points of interest and the point of interest embedding matrix. The point of interest embedding matrix is ​​obtained by pre-training by using contrastive learning through relational distillation. The distance between the point of interest and the same category of interest points is shortened by contrastive learning, and the distance between the point of interest and the different category of interest points is increased, so that the embedded representation of the point of interest has better discrimination.

[0107] Furthermore, the geographical distance of the points of interest was used as the threshold in the classifier to filter out some unreasonable prediction points, effectively improving the classification effect of the model.

[0108] In addition, since category information is added as a guide in the encoding, the interest points of the same category are closer in the latent space. Correct interest point category prediction can effectively help the prediction of interest points and achieve mutual promotion. Therefore, while predicting the interest points, the 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 a method for recommending points of interest, and the algorithm framework of the point of interest recommendation model is as follows: Figure 1 shown.

[0111] The process of training its POI recommendation model includes the following steps:

[0112] S1. Build training set

[0113] In this embodiment, the check-in data includes the check-in user tag and the check-in point of interest information. The point of interest information includes the point of interest tag and the location information, category information and check-in time of the point of interest; the category information of the point of interest includes the category tag. The introduction of category information helps to enrich the expression of user preferences, which can realize the prediction of the category of the point of interest. The specific content of the point of interest information can be selected according to the actual situation. For example, if only the point of interest is predicted, only the location information and the check-in time can be included.

[0114] Then, based on the information of the signed-in users, the information of the points of interest of each user is extracted from the sign-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 according to the timeline is taken as the real sign-in, and the trajectory composed of the remaining points of interest except the real sign-in constitutes the current trajectory; training samples are constructed based on each current trajectory, and the training samples include the current trajectory, the real sign-in belonging to the same training trajectory as the current trajectory, and the historical trajectory belonging to the training trajectory 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 natural days, that is, the trajectory of one day constitutes a training trajectory.

[0115] S2. Constructing the coding matrix

[0116] In this step, based on the data in step S1, the interest point embedding matrix, category coding embedding matrix and time coding embedding matrix are constructed respectively.

[0117] Among them, the pre-training of the interest point embedding matrix includes:

[0118] C1. Data preparation

[0119] Obtain the check-in data described in step S1, and 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 to the interest points in the interest point set.

[0120] C2. Input an interest point p in the interest point set i , as the current anchor point.

[0121] C3, extract and current anchor point p i Same categoryc k The points of interest constitute the current anchor point p i The positive sample set D cp (c k ); From the interest point set, the current anchor point p i , next point of interest i+1 And the positive sample set D cp (c k ) other points of interest other than the points of interest included in the sample, and construct the current anchor point p i The negative sample set, the next interest point p i+1 is the current anchor point p ii The track is located at the current anchor point p along the timeline iThat is, the interest points in the negative sample set of the current anchor point are other interest points in the interest point set that have different activity categories from the current anchor point and are not the next interest point.

[0122] C4. Using the interest point embedding matrix, based on the mapping relationship between the interest point and the interest point embedding matrix, the embedded representation of the anchor point and each interest point in the positive sample set and the negative sample set is obtained.

[0123] C5. Using the embedded representation of the interest points obtained in step C4, comparative learning is performed between the anchor points and the interest points contained in the positive sample set, and between the anchor points and the interest points contained in the negative sample set, relationship distillation is performed, and the interest point embedding matrix is ​​updated.

[0124] C6. Loop through steps C2 to C5 until all the interest points in the interest point set are traversed to obtain an interest point embedding matrix.

[0125] In order to facilitate the extraction of the positive sample set in step C3, the points of interest in the point of interest set are traversed, and the point of interest category dictionary D is constructed based on the point of interest category labels. cp , the dictionary is represented in the form of key-value pairs, such as: Category ID: S cp , where S cp represents all interest points with the same category label.

[0126] The purpose of pre-training is to maximize the distance between the positive sample cluster and the negative sample cluster based on the loss. Therefore, any existing method can be used. Specifically, in this embodiment, the embedded representation of the interest point obtained in step C4 is used to perform comparative learning between the anchor point and the interest points included in the positive sample set and between the anchor point and the interest points included in the negative sample set according to the following formula, and the relationship distillation is performed based on minimization expectation to update the interest point embedding matrix:

[0127]

[0128] in, represents the minimization expectation, P is the set of interest points, s(·) represents the similarity calculation, p i is the current anchor point, p i+1 is the current anchor point p i The track is located at the current anchor point p along the timeline i Points of interest later, p r is the positive sample set D cp (c k ) and the current anchor point p i Points of interest of the same category, p j is the jth negative sample, J represents the number of interest points sampled from the negative sample set; v(p i )、v(pj )、v(p i+1 ) and v(p r ) represent p i 、p j 、p i+1 and p r The embedded representation of .

[0129] Since this embodiment introduces rich information about points of interest, and adopts the above-mentioned method, using contrastive learning, and obtaining the embedding matrix of the points of interest through pre-training by means of relational distillation, it is possible to fully extract the feature information of the points of interest.

[0130] The category code embedding matrix is ​​obtained by calculating the statistical frequency of each category using the category of each interest point in the interest point set according to the following steps, and the category code embedding matrix is ​​obtained based on the statistical frequency of the category:

[0131] The distribution of all interest points in the interest point set in each category is counted to obtain the statistical frequency of each category.

[0132] A category coding one-hot matrix is ​​established, wherein the row and column dimensions of the category coding one-hot matrix are respectively the number of interest points and the number of categories in the interest point set, 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, the category coding one-hot matrix is ​​used to obtain the category coding embedding matrix through the fourth encoding network.

[0133] The time code embedding matrix is ​​obtained by calculating the statistical frequency of each time period using the check-in time of each point of interest in the point of interest set according to the following steps, and the time code embedding matrix is ​​obtained based on the statistical frequency of the time period:

[0134] The time interval of the training trajectory divided in step S1 is subdivided into time periods, and the distribution of all interest points in the interest point set in each time period is counted 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 coding one-hot matrix is ​​established, wherein the row and column dimensions of the time coding one-hot matrix are respectively the number of interest points in the interest point set and the number of time periods, and the value of each element of the time coding one-hot matrix is ​​the statistical frequency of the time period to which the corresponding interest point belongs; and the time coding one-hot matrix is ​​used to obtain a time coding embedding matrix through a fifth coding network.

[0136] The fourth coding network and the fifth coding network can be implemented in an existing manner, such as using a fully connected network. In this embodiment, the fourth coding network and the fifth coding network both use linear transformation for encoding;

[0137] According to the following formula, use the category encoding one-hot matrix A cand the time-encoded one-hot matrix A t , through linear transformation, we get the category encoding embedding matrix V c and the temporal encoding embedding matrix V t :

[0138] V c =Tanh(A c W vc )

[0139] V t =Tanh(A t W vt )

[0140] Among them, Tanh represents the activation function, W vc and W vt are the parameters of the linear transformation.

[0141] S3, interest point encoding

[0142] In this step, first, each interest point contained in the historical trajectory of the input training sample is encoded separately to obtain the embedded representation of each interest point, including:

[0143] S31, inputting each point of interest included in the historical trajectory of the training sample;

[0144] S32, based on the information of the points of interest, using the point of interest embedding matrix, that is, the first coding network, based on the mapping relationship between the points of interest and the point of interest embedding matrix, obtain the embedding representation of each input point of interest; using the category coding embedding matrix, that is, the second coding network, based on the category information of the points of interest, obtain the category embedding representation of the input points of interest; using the time coding embedding matrix, that is, the third coding network, based on the check-in time of the points of interest, obtain the time embedding representation of the input points of interest;

[0145] S33. By aggregation, the initial embedding representation of the input interest point is fused with its category embedding representation and time embedding representation to obtain the final embedding representation of the input interest point.

[0146] In this embodiment, the aggregation method is a frequency gating network; through the frequency gating network, the input interest point p is converted into τ The initial embedding representation v(p τ ), and fuse its category embedding representation v c (p τ ) and the time embedding representation v t (p τ ), and obtain the final embedding representation v′(p τ ):

[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 the memory network, E gen represents the generalization network, and 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 τ ) is the output of the frequency gating network, g(τ) c,t E gen (v c (p τ )+v t (p τ )) represents the category embedding representation v of the interest point c (p τ ) and the time embedding representation v t (p τ ) Output of the frequency gating network; τ freq represents the statistical frequency of the interest point in the interest point set, W g Represents the feature transformation matrix.

[0151] After obtaining the embedded representation of each point of interest, in order to ensure the subsequent attention calculation, it is necessary to add a position encoding vector to the embedded 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.

[0152] In this embodiment, first, according to the order of the check-in time of each point of interest, the position code PE is obtained by absolute position coding. τ , according to the following formula, the embedding representation v′(p τ )Add position code PE τ , obtain the feature representation v″(p τ ):

[0153] v″(p τ )=v′(p τ )+PE τ

[0154] Among them, τ represents the position number of the interest point in the trajectory according to its check-in time.

[0155] S4. Learning short-term preferences

[0156] In this step, the last point of interest of the current trajectory according to 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 calculation is performed on each point of interest contained therein. Based on the self-attention score of the predicted reference point, the short-term active hidden state of the training sample is obtained.

[0157] Specifically, first, according to the following formula, the feature representation of each interest point contained in the current trajectory of the input training sample is used as input, and the self-attention calculation is performed on each interest point contained therein:

[0158]

[0159] Among them, Softmax represents the Softmax function, T represents the matrix transpose, and d k is the output dimension of the attention head, S (h) represents the attention score of the hth head; Q (h) , K (h) and V (h) They are the Query value, Key value and Value value obtained by the transformation matrix of the h-th head using the feature representation;

[0160] Then, the self-attention score S of each attention head is calculated according to the following formula: (h) , fused and normalized to obtain the short-term activity representation S of the training sample b :

[0161] S b =LayerNorm([S (1) ,S (2) ,…,S (h) …,S (H) ]W S +b S )

[0162] Among them, LayerNorm represents layer normalization, H represents the number of attention heads of multi-head self-attention, and W s and b S are the trainable parameters of the fully connected network that fuses the outputs of the H attention heads, b represents the sequence number of the training sample; the short-term activity representation S with context information is finally obtainedb .

[0163] Afterwards, the obtained short-term activity is expressed as S b , perform average pooling to obtain short-term active hidden states

[0164] S5. Learning long-term preferences

[0165] In this step, the feature representation of each interest point contained in the historical trajectory of the input training sample is concatenated to form a feature matrix of the historical trajectory; the feature matrix of the historical trajectory and the short-term active hidden state of the training sample are used to obtain the long-term preference tensor of the training sample based on the cross-attention mechanism.

[0166] Specifically, first, the feature matrix L of the historical trajectory is constructed by inputting the feature representation of each interest point contained in the historical trajectory of the training sample; the feature matrix L of the historical trajectory and the short-term activity hidden state of the training sample are used According to the following formula, cross attention calculation is performed:

[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 of the cross attention mechanism z is normalized and compared with the short-term active hidden state Perform residual connection to obtain long-term preference tensor

[0171]

[0172] Among them, LayerNorm represents layer normalization, and b represents the sequence number of the training sample.

[0173] S6. Point of Interest Prediction

[0174] In this step, the next point of interest is predicted using the inference network based on the short-term active hidden state and long-term preference tensor of the input training samples.

[0175] The inference network can adopt any existing method, such as traditional machine learning models such as vector machines, decision trees, and random forests.

[0176] Furthermore, the inference network includes an interest point classifier and a category classifier, and each of them is composed of a fully connected network;

[0177] Short-term active hidden states based on input training samples and the long-term preference tensor According to the following formula, use the inference network to predict the next point of interest;

[0178]

[0179] in, is the probability distribution vector of the predicted n+1th interest point at each interest point, is the probability distribution vector of the predicted n+1th interest point in each category, W p , W c , b p and b c They represent trainable parameters respectively, and Softmax represents the Softmax function.

[0180] In this embodiment, the inference network includes a point of interest classifier and a category classifier, and each is composed of a fully connected network; at the same time, a neighboring position matrix is ​​introduced, and the geographical location distance of the point of interest is used as a threshold to screen out some unreasonable prediction points, thereby effectively improving the classification effect of the model.

[0181] Specifically, based on the short-term active hidden state of the input training sample and the long-term preference tensor According to the following formula, use the inference network to predict the next point of interest;

[0182]

[0183] in, is the probability distribution vector of the predicted n+1th interest point at each interest point, is the probability distribution vector of the predicted n+1th interest point in each category, W p , W c , b p and b c Respectively represent trainable parameters, Softmax represents the Softmax function; V near is the neighboring position matrix.

[0184] The neighboring position matrix V nearThe dimension is B×N, where B represents the number of training samples input in this round of training, and N represents the number of interest points in the interest point set, and the interest point set is a set of all interest points in the check-in data in step A1; for the current trajectory of each training sample input in this round of training, the last interest point arranged in its timeline is extracted as its prediction reference point, and 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 is assigned a value of α, otherwise it is assigned a value of 1; α is a preset coefficient and α>1. In this embodiment, the distance threshold is 1km, which is calculated by the longitude and latitude between the points of interest.

[0185] S7. Update model parameters

[0186] In this step, the cross entropy loss is calculated based on the predicted POIs and actual sign-ins of each training sample input in this round of training, and the model parameters are updated using gradient descent based on the cross entropy loss.

[0187] Since the category prediction is performed, the cross entropy loss is calculated as follows:

[0188]

[0189] Among them, L b is the cross entropy loss of the bth training sample, L is the total loss of this round of training, and p n+1 is the actual sign-in point of interest label of the b-th training sample, is the probability distribution vector of the n+1th interest point predicted by the bth training sample at each interest point, c n+1 is the category label of the real sign-in of the b-th training sample, is the probability distribution vector of the n+1th interest point predicted by the bth training sample in each category. β is a preset coefficient. By setting the parameters of β, the training directions of category prediction and interest point prediction can be made similar.

[0190] S8. Iterative training

[0191] By looping steps S3-S7 until the training termination condition is reached, a trained POI recommendation model is obtained.

[0192] Based on the above process, we can obtain a trained POI recommendation model. In actual application scenarios, we use all the check-in data of the user to be recommended to build his / her historical trajectory. According to the preset time interval, we use the check-in data contained in the last time interval of the user to be recommended to build his / her current trajectory. Then, we use the trained POI recommendation model to output the next POI using the historical trajectory and current trajectory as input.

[0193] Experimental verification:

[0194] Eight other common models in the prior art were selected as comparative experiments, and the effect of the POI recommendation model of the embodiment of the present invention was evaluated on two real-world trajectory datasets. The results are shown in Table 1. The two real-world trajectory datasets are the New York City (abbreviated as NYC in the table) dataset and the Tokyo dataset of Foursquare. For different models, the data is processed differently according to their input interface requirements to ensure the normal operation of the model.

[0195] In the table, ACC@K represents the accuracy of the recommendation model, which is calculated as the ratio of the number of target values ​​in the first K values ​​of the recommended model's predicted output value divided by the total number. The larger the ratio, the higher the accuracy of the model. In this experiment, K=1, 5, i.e., ACC@1 and ACC@5, were selected. AUC is the area under the receiver operating characteristic curve (ROC), which is a commonly used indicator in classification models. Its value is usually between (0.5-1). The larger the AUC value, the better the classifier effect. MAP is the average hit accuracy, which is also a commonly used indicator in recommendation models. However, this indicator reflects the average level of the recommendation model and can comprehensively consider the prediction accuracy of the model. The larger the AUC value, the better the model effect.

[0196] Table 1: Performance comparison of the embodiment model and the prior art model on two data sets

[0197]

[0198] In Table 1, Ours is the POI recommendation model of the embodiment of the present invention, and GRU, ST-RNN, HST-LSTM, DeepMove, VANext, MobTCast, CFPRec and SSDL are 8 common recommendation models in the prior art. As can be seen from Table 1, the model of the embodiment has achieved improvements in various indicators compared with other models on the two data sets.

[0199] Furthermore, the model of the embodiment of the present invention is used to randomly select some trajectory data on the New York City dataset for testing. We record the sequence of interest points, category points, predicted interest points, real interest points, and the frequency of occurrence of predicted interest points and real interest points in the training set / test set / user of the trajectory to verify whether the model can predict low-frequency points and whether it has the ability to make predictions based on categories. The experimental results are shown in Table 2.

[0200] Table 2. Random case test results of the embodiment model on the New York City dataset

[0201]

[0202] As can be seen from Table 2, the model of the embodiment of the present invention has achieved accurate results on the three users numbered 89, 101, and 885. At the same time, we also need to pay attention to two types of situations, such as users 58 and 791. In these examples, the categories of points of interest 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 categories of points of interest were both two points of Light Rail, among which the user reached the point of interest numbered 10380 66 times and the point of interest numbered 11896 only 14 times. Similarly, for user 791, the point of interest numbered 21988 is also a point with a higher frequency of visits. This reflects that the present invention can pay attention to the long-term preferences of users and reflects the guiding role of homogenized activities.

[0203] However, due to the complexity and variability of human behavior, it is difficult to fully capture it. There are always some other situations, and the method of the present invention cannot be perfect. For example, in the last case in Table 2, the category of the interest point predicted by the model of the present invention is inconsistent with the real category, and the predicted interest point also deviates from the real interest point. Analysis may be caused by the model ignoring the distance and transportation mode of returning home.

[0204] However, through the above experiments, it can be proved that the POI recommendation model in the present invention is superior to other recommendation models in the prior art in terms of overall performance.

[0205] Finally, it should be noted that the above embodiments are only preferred implementations and are not intended to limit the present invention. It should be pointed out that for those skilled in the art, several modifications, equivalent replacements, improvements, etc. can be made without departing from the scope of the present invention and the scope of protection of the claims, and all of these should be included in the protection scope of the present invention.

Claims

1. A method for recommending points of interest, It is characterized in that The following steps are involved: A. Training the POI recommendation model A1. Constructing a training set Acquire sign-in data, the sign-in data including a sign-in user tag and sign-in point of interest information, the point of interest information including a point of interest tag and location information of the point of interest and a sign-in time; Based on the sign-in user tags, the interest point information of each user is extracted from the sign-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 except the real check-in constitutes the current trajectory; Constructing training samples based on each current trajectory respectively, wherein the training samples include the current trajectory, the real check-in belonging to the same training trajectory as the current trajectory, and the historical trajectory belonging to the training trajectory to which the current trajectory belongs; Construct a training set based on the training samples; A2. Extract at least one training sample from the training set as the input for this round of training. For each input training sample, process it according to the following steps: A21. Encode each point of interest contained in the historical trajectory of the input training sample to obtain an embedded representation of each point of interest; add a position encoding vector to the embedded representation of each point of interest according to the order of the check-in time of each point of interest to obtain a feature representation of each point of interest; A22, taking the feature representation of each interest point contained in the current trajectory of the input training sample as input, performing self-attention calculation on each interest point contained therein, and obtaining the short-term active hidden state of the training sample based on the self-attention score; A23. The feature representation of each interest point contained in the historical trajectory of the input training sample is concatenated to form a feature matrix of the historical trajectory; the long-term preference tensor of the training sample is obtained based on the cross-attention mechanism using the feature matrix of the historical trajectory and the short-term active hidden state of the training sample; A24, based on the short-term active hidden state and long-term preference tensor of the input training sample, use the inference network to predict the next point of interest; A3. Based on the predicted points of interest and actual check-ins of each training sample input in this round of training, calculate the cross entropy loss, and use gradient descent to update the model parameters according to the cross entropy loss; A4, looping steps A2-A3 until the training termination condition is reached, and obtaining a trained POI recommendation model; B. Perform recommended tasks: The historical trajectory of the user to be recommended is constructed with all the check-in data. The current trajectory of the user to be recommended is constructed with the check-in data contained in the last time interval of the timeline at the preset time interval. Then, the historical trajectory and the current trajectory are used as input, and the trained POI recommendation model is used to output the next POI.

2. A method for recommending points of interest according to claim 1, Features: In step A24, the inference network includes a point of interest classifier composed of a fully connected network: based on the short-term active hidden state of the input training sample and the long-term preference tensor Using the POI classifier, predict the next POI according to the following formula: in, is the probability distribution vector of the predicted n+1th interest point at each interest point, b represents the sequence number of the training sample; W p and b p They represent the trainable parameters of the fully connected network of the interest point classifier, Softmax represents the Softmax function; V near is the neighboring position matrix; The neighboring position matrix V near The dimension is B×N, where B represents the number of training samples input in this round of training, and N represents the number of interest points in the interest point set, and the interest point set is a set of all interest points in the check-in data in step A1; for the current trajectory of each training sample input in this round of training, the last interest point arranged in its timeline is extracted as its prediction reference point, and 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 is assigned a value of α, otherwise it is assigned a value of 1; α is a preset coefficient and α>1.

3. A method for recommending points of interest according to claim 1, It is characterized in that The check-in data includes a check-in user tag and check-in point of interest information, wherein the point of interest information includes a point of interest tag and location information, category information and check-in time of the point of interest; the category information of the point of interest includes a category tag; In step A21, each interest point included in the historical trajectory of the input training sample is encoded respectively to obtain an embedded representation of each interest point, which specifically includes: A211, input each point of interest contained in the historical trajectory of the training sample; A212, based on the information of the interest points, using the first encoding network, obtaining an initial embedding representation of the input interest points; using the second encoding network, obtaining a category embedding representation of the input interest points; using the third encoding network, obtaining a time embedding representation of the input interest points; A213. By aggregation, the initial embedding representation of the input interest point is fused with its category embedding representation and time embedding representation to obtain the final embedding representation of the input interest point.

4. A method for recommending points of interest as claimed in claim 3, It is characterized in that Taking the points of interest contained in the historical trajectory of the input training sample as input; The first encoding network uses the interest point embedding matrix to obtain an embedding representation of each input interest point based on a mapping relationship between the interest point and the interest point embedding matrix; The second encoding network obtains a category embedding representation of the input interest point based on the category information of the interest point using the category encoding embedding matrix; The third encoding network obtains a time embedding representation of the input interest point based on the check-in time of the interest point using the time encoding embedding matrix; The interest point embedding matrix corresponds to the interest points in the interest point set one by one, and is obtained through pre-training by contrastive learning and relational distillation. The interest point set is a set of all interest points in the check-in data in step A1. The categories of each interest point in the interest point set are used to calculate the statistical frequency of each category, and the category coding embedding matrix is ​​calculated based on the statistical frequency of the category. Using the check-in time of each point of interest in the point of interest center, the statistical frequency of each time period is calculated, and the time coding embedding moment is calculated based on the statistical frequency of the time period; The time period is obtained by subdividing the time interval of the current trajectory in step A1.

5. A method for recommending points of interest as claimed in claim 4, Features: The pre-training of the interest point embedding matrix includes: C1. Data preparation Acquire the check-in data described in step A1, and construct an interest point set based on the interest point tags of the interest points contained therein; construct and initialize an interest point embedding matrix, wherein the elements of the interest point embedding matrix correspond one-to-one to the interest points in the interest point set; C2. Input an interest point p in the interest point set i , as the current anchor point; C3, extract and current anchor point p i Same categoryc k The points of interest constitute the current anchor point p i The positive sample set D cp (c k ); From the interest point set, the current anchor point p i , next point of interest i+1 And the positive sample set D cp (c k ) other points of interest other than the points of interest included in the sample, and construct the current anchor point p i The negative sample set, the next interest point p i+1 is the current anchor point p i The track is located at the current anchor point p along the timeline i Points of interest afterwards; C4, using the interest point embedding matrix, based on the mapping relationship between the interest point and the interest point embedding matrix, obtain the embedding representation of the anchor point and each interest point in the positive sample set and the negative sample set; C5, using the embedded representation of the interest point obtained in step C4, using comparative learning between the anchor point and the interest points included in the positive sample set and between the anchor point and the interest points included in the negative sample set, performing relationship distillation, and updating the interest point embedding matrix; C6. Loop through steps C2 to C5 until all the interest points in the interest point set are traversed to obtain an interest point embedding matrix.

6. A method for recommending points of interest as claimed in claim 5, Features: In step C5, using the embedded representation of the interest point obtained in step C4, the interest point embedding matrix is ​​updated according to the following formula, using the comparative learning between the anchor point and the interest points included in the positive sample set and between the anchor point and the interest points included in the negative sample set, and performing relation distillation based on minimization expectation: in, represents the minimization expectation, P is the set of interest points, s(·) represents the similarity calculation, p i is the current anchor point, p i+1 is the current anchor point p i The track is located at the current anchor point p along the timeline i Points of interest later, p r is the positive sample set D cp (c k ) and the current anchor point p i Points of interest of the same category, p j is the jth negative sample, J represents the number of interest points sampled from the negative sample set; v(p i )、v(p j )、v(p i+1 ) and v(p r ) represent p i 、p j 、p i+1 and p r The embedded representation of .

7. A method for recommending points of interest as claimed in claim 4, Features: The category code embedding matrix is ​​obtained by the following steps: Count the distribution of all interest points in the interest point set in each category to obtain the statistical frequency of each category; establish a category coding one-hot matrix, 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, 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, the category encoding one-hot matrix is ​​used to obtain the category encoding embedding matrix through the fourth encoding network; The time code embedding matrix is ​​obtained by the following steps: The time interval of the training trajectory divided in step A1 is subdivided into time periods, and the distribution of all interest points in the interest point set in each time period is counted to obtain the statistical frequency of each time period; a time coding one-hot matrix is ​​established, and the row and column dimensions of the time coding one-hot matrix are the number of interest points in the interest point set and the number of time periods, respectively, and the value of each element of the time coding one-hot matrix is ​​the statistical frequency of the time period to which the corresponding interest point belongs; using the time coding one-hot matrix, a time coding embedding matrix is ​​obtained through a fifth encoding network.

8. A method for recommending points of interest as claimed in claim 7, It is characterized in that The fourth coding network and the fifth coding network both use linear transformation to perform coding; According to the following formula, use the category encoding one-hot matrix A c and the time-encoded one-hot matrix A t , through linear transformation, we get the category encoding embedding matrix V c and the temporal encoding embedding matrix V t : V c =Fish(A) c W vc ) V t =Fish(A) t W vt ) Among them, Tanh represents the activation function, W vc and W vt are the parameters of the linear transformation.

9. A method for recommending points of interest according to any one of claims 3 to 8, It is characterized in that The aggregation network is a frequency gated network; in step A213, the input point of interest p is converted into τ The initial embedding representation v(p τ ), and fuse its category embedding representation v c (p τ ) and the time embedding representation v t (p τ ), and obtain the final embedding representation v′(p τ ): 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 the memory network, E gen represents the generalization network, and 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 τ ) is the output of the frequency gating network, g(τ) c,t E gen (v c (p τ )+v t (p τ )) represents the category embedding representation v of the interest point c (p τ ) and the time embedding representation v t (p τ ) Output of the frequency gating network; τ freq represents the statistical frequency of the interest point in the interest point set, W g Represents the feature transformation matrix.

10. A method for recommending points of interest according to any one of claims 1 to 8, It is characterized in that In step A21, first, according to the order of the check-in time of each point of interest, the position code PE is obtained by absolute position coding. τ , according to the following formula, the embedding representation v′(p τ )Add position code PE τ , obtain the feature representation v″(p τ ): v″(p τ )=v′(p τ )+PE τ Among them, τ represents the position number of the interest point in the trajectory according to its check-in time.

11. A method for recommending points of interest according to any one of claims 1 to 8, It is characterized in that In step A22, according to the following formula, the feature representation of each interest point contained in the current trajectory of the input training sample is used as input, and self-attention calculation is performed on each interest point contained therein: Among them, Softmax represents the Softmax function, T represents the matrix transpose, and d k is the output dimension of the attention head, S (h) represents the attention score of the hth head; Q (h) , K (h ) and V (h) They are the Query value, Key value and Value value obtained by the transformation matrix of the h-th head using the feature representation; Then, the self-attention score S of each attention head is calculated according to the following formula: (h) , fused and normalized to obtain the short-term activity representation S of the training sample b : S b =LayerNorm([S (1) ,S (2) ,...,S (h) …,S (H) ]W S +b S ) Among them, LayerNorm represents layer normalization, H represents the number of attention heads of multi-head self-attention, and W s and b S are the trainable parameters of the fully connected network that fuses the outputs of the H attention heads, and b represents the sequence number of the training sample; Afterwards, the obtained short-term activity is expressed as S b , perform average pooling to obtain short-term active hidden states 12. A method for recommending points of interest according to any one of claims 1 to 8, It is characterized in that In step A23, the feature matrix L of the historical trajectory is constructed by inputting the feature representation of each interest point contained in the historical trajectory of the training sample; the feature matrix L of the historical trajectory and the short-term activity hidden state of the training sample are used According to the following formula, cross attention calculation is performed: 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 of the cross attention mechanism z is normalized and compared with the short-term active hidden state Perform residual connection to obtain long-term preference tensor Among them, LayerNorm represents layer normalization, and b represents the sequence number of the training sample.

13. A method for recommending points of interest according to any one of claims 5 to 8, It is characterized in that In step A24, the inference network also includes a category classifier composed of a fully connected network; based on the short-term active hidden state of the input training sample and the long-term preference tensor Using the POI classifier, predict the category of the next POI according to the following formula: in, is the probability distribution vector of the predicted n+1th interest point in each category, W c and b c They represent trainable parameters respectively, and Softmax represents the Softmax function.

14. A method for recommending points of interest according to claim 13, It is characterized in that In step A3, the cross entropy loss is calculated as follows: Among them, L b is the cross entropy loss of the bth training sample, L is the total loss of this round of training, and p n+1 is the actual sign-in point of interest label of the b-th training sample, is the probability distribution vector of the n+1th interest point predicted by the bth training sample at each interest point, c n+1 is the category label of the real sign-in of the b-th training sample, is the probability distribution vector of the n+1th interest point predicted by the bth training sample in each category, and β is the preset coefficient.

Citation Information

Patent Citations

  • Next interest point recommendation method based on spatio-temporal power law attention

    CN115935065A

  • Next interest point recommendation system based on spatio-temporal power law attention

    CN115952355A

  • Method for recommending next interest point based on multi-active-area sensing network

    CN116401461A

  • Interest point recommendation method based on space-time perception

    CN117271899A

  • Query auto-completion method and apparatus, device and computer storage medium

    US20220342936A1