Interest point recommendation method and device based on trajectory semantics and attention preference
By introducing trajectory semantics and attention preferences, using multi-dimensional feature embedding and self-attention mechanisms, the problems of collaborative information capture and personalized diversity trade-offs in existing systems are solved, and more accurate and adaptive interest recommendations are achieved.
Patent Information
- Application Number
- CN202510406966.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-02
- Publication Date
- 2025-07-25
AI Technical Summary
Existing point-of-interest recommendation systems are difficult to effectively capture the collaborative information in trajectory recommendations and cannot effectively weigh the personalized recommendations and diversity.
By introducing trajectory semantics and attention preference methods, using multi-dimensional feature embedding and self-attention mechanisms, combining user historical trajectories and group collaboration signals, a point of interest recommendation model is constructed, user behavior patterns are captured, and personalization and diversity are balanced.
It improves the accuracy and adaptability of point-of-interest recommendations, can better identify users' potential points of interest, adapt to dynamically changing user needs, and provide efficient and personalized recommendations.
Smart Images

Figure CN120372081A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of point - of - interest (POI) recommendation, and particularly to a POI recommendation method and device based on trajectory semantics and attention preference. Background Art
[0002] The core task of point - of - interest (POI) recommendation is to predict the locations that a user may visit in the future based on the user's historical trajectories. Existing research mainly relies on the interaction sequences between users and POIs, and models them by combining time, space, and user preferences. For example, early research used personalized Markov chains (FPMC) to model the user's transition patterns, or learned spatio - temporal changes through spatio - temporal recurrent neural networks (ST - RNN). However, these methods still have limitations in capturing the high - order semantic features of trajectories and user collaboration signals. With the development of deep learning, recommendation methods based on attention mechanisms have been proposed to enhance the ability to model user preferences. For example, DeepRP uses a backtracking attention mechanism to identify user preferences at different time granularities, BayMAN captures time, distance, and semantic information through multi - perspective attention, and STAN combines self - attention mechanism to model discontinuous access patterns. However, these methods are still difficult to fully mine the collaboration information of potentially similar - thinking users and achieve a balance between personalized recommendation and recommendation diversity.
[0003] Although the above - mentioned models have achieved good results in capturing various preference relationships of user POIs. However, there are two important problems in POI recommendation:
[0004] The problem of capturing collaboration information in trajectory recommendation. Traditional trajectory recommendation systems mainly model based on individual historical behaviors, ignoring the collaboration information between potentially similar - thinking users. At the same time, when modeling user trajectories, they are often limited by the length of the trajectory, resulting in insufficient information for short trajectories and redundant information for long trajectories.
[0005] The trade - off problem between personalized recommendation and diversity. Traditional recommendation systems usually tend to be personalized, resulting in overly single recommendation results and lack of exploration; or emphasize diversity but weaken the personalized experience. Existing models cannot achieve a balance between the two and generate recommendation results that both meet user interests and have exploration. Summary of the Invention
[0006] In view of this, the purpose of the present invention is to provide a POI recommendation method and device based on trajectory semantics and attention preference, which are used to solve the problems that the existing recommendation systems have difficulty in capturing collaboration information in trajectory recommendation and cannot effectively balance between personalized recommendation and diversity.
[0007] The present invention provides a POI recommendation method based on trajectory semantics and attention preference, including the steps:
[0008] S1: Obtain the check-in record data set of user u, preprocess the check-in record data set to obtain the original trajectory;
[0009] S2: Calculate the embedding set through the original trajectory, and calculate the joint feature matrix M J and the explicit feature matrix M E ;
[0010] S3: Build a point-of-interest recommendation model, and train the point-of-interest recommendation model through the joint feature matrix M J and the explicit feature matrix M E to obtain a trained point-of-interest recommendation model;
[0011] S4: Calculate the preference probability set through the trained point-of-interest recommendation model, and recommend points of interest to user u through the preference probability set.
[0012] Preferably:
[0013] The expression of the original trajectory is: where is the location of the nth point of interest;
[0014] The embedding set includes: user embedding e u , point-of-interest embedding e i , semantic embedding e s , time embedding e t , time-aware category embedding e C , time interval embedding e Δt and spatial interval embedding e Δd .
[0015] Preferably, step S2 is specifically:
[0016] S21: Obtain all points of interest through the original trajectory of user u, and construct a point-of-interest set L through each point of interest;
[0017] S22: Calculate the user embedding e u and the point-of-interest embedding e i , and the calculation formula is:
[0018]
[0019] where l i represents the i-th point of interest, l i ∈L, F embed () represents an embedding function that maps a given entity to a fixed-dimensional vector space;
[0020] S23: Obtain the attribute d of the point of interest and the time t from the original trajectory, and perform semantic scoring on the attribute d through a point-by-point feedforward neural network to obtain the semantic embedding e; capture the cross-category access periodicity of the time t through Time2Vec encoding to obtain the time embedding e; integrate the semantic embedding e and the time embedding e to obtain the time-aware category embedding e; s and time t, perform semantic scoring on the attribute d through a point-by-point feedforward neural network s to obtain the semantic embedding e s ; capture the cross-category access periodicity of the time t through Time2Vec encoding to obtain the time embedding e t ; integrate the semantic embedding e s and the time embedding e t to obtain the time-aware category embedding e C ;
[0021] S24: Obtain the time interval Δt and the space interval Δd from the original trajectory, construct the time-aware parameter matrix W T and the distance-aware parameter matrix W D , calculate to obtain the time interval embedding e Δt and the space interval embedding e Δd , and the calculation formula is:
[0022]
[0023]
[0024] where λ represents the time decay rate and T is the transpose symbol;
[0025] S25: Project the original trajectory into the joint feature matrix M through the user embedding e u and the point-of-interest embedding e i ; J ;
[0026] S26: Perform dense vector representation on the time interval embedding e Δt and the space interval embedding e Δd respectively to obtain the time interval dense vector M Δt and the space interval dense vector M Δd ;
[0027] S27: Perform weighted aggregation on the time interval dense vector M Δt and the space interval dense vector M Δd to obtain the explicit feature matrix M E .
[0028] Preferably:
[0029] The point-of-interest recommendation model includes: a trajectory semantic representation module, an attention preference integration module, and a user preference matching module;
[0030] The trajectory semantic representation module and the attention preference integration module are connected to the user preference matching module.
[0031] Preferably, step S3 is specifically as follows:
[0032] S31: Input the joint feature matrix M of user u J into the trajectory semantic representation module. By capturing the past and future contexts, obtain the hidden feature matrix wherein, is the forward hidden state vector, is the backward hidden state vector; wherein, T is the transpose symbol;
[0033] S32: Construct the check-in frequency matrix M F , where the element f ui represents the frequency of user u accessing the point of interest l i ; Through the trajectory semantic representation module, enhance the check-in frequency matrix M F to obtain the enhanced check-in frequency matrix M' F ;
[0034] S33: Calculate and obtain the latent feature matrix M H from the hidden feature matrix M F and the enhanced check-in frequency matrix M' L , and the calculation formula is:
[0035] M L = softmax(Q u ⊙tanh(M′ F ×M H ))
[0036] wherein, Q u is the training parameter, ⊙ represents dot product attention, and softmax() represents the normalized exponential function;
[0037] Perform ReLU transformation dot product attention on the latent feature matrix M L and to obtain the semantic representation matrix of user u
[0038] S34: Input the latent feature matrix M L and the explicit feature matrix M E into the attention preference integration module to construct the head attention, and the expression of the head attention is:
[0039]
[0040] wherein, head j is the j-th head attention, and are respectively the Query, Key, and Value weight parameter matrices of the j-th head attention, and T is the transpose symbol;
[0041] S35: Obtain the attention head feature H through the attention calculation of each head A , the calculation formula is:
[0042]
[0043] Among them, n h is the total number of head attentions, Concat() represents the concatenation function, W O is the output weight matrix;
[0044] Through the attention head feature H A Calculate the self-attention aggregation matrix M A , the calculation formula is:
[0045] M A =Dropout(LayerNorm(H A ))
[0046] Among them, LayerNorm() represents the layer normalization operation, and Dropout() represents the execution of the Dropout operation;
[0047] S36: Calculate the total cosine similarity between user u and other most similar users, and calculate the user u's interest point l through the total cosine similarity calculation i The predicted score probability
[0048] S37: For user u, construct the interest point embedding matrix E through all interest point embeddings L , through the self-attention aggregation matrix M A And the interest point embedding matrix E L Calculate the probability score set of interest points The calculation formula is:
[0049]
[0050] Among them, WeightAgg() represents weighted aggregation;
[0051] S38: By predicting the probability of scoring and interest point probability score set Calculate the user u's interest point l i The predicted preference probability The calculation formula is:
[0052]
[0053] Among them, Fusion() represents a feedforward neural network activated by softmax. For point of interest l i is the probability score of the point of interest, and is the learning weight;
[0054] S39: Repeat step S38 until the predicted preference probabilities of all points of interest are obtained, and calculate the cross-entropy loss through the predicted preference probabilities of all points of interest
[0055] S310: Repeat steps S31 - S39 until the cross-entropy loss is less than the preset value to obtain the trained point-of-interest recommendation model.
[0056] Preferably, in step S36:
[0057] The total cosine similarity between user u and user v is calculated as:
[0058]
[0059] where represents the k-th row vector of matrix and represents the k-th row vector of matrix ||·|| represents the Euclidean norm;
[0060] The predicted rating probability is calculated as:
[0061]
[0062] where N(u) represents the set of users most similar to user u, represents the rating probability of user v for point of interest l i is the probability score of the point of interest.
[0063] Preferably, in step S39:
[0064] The cross-entropy loss is calculated as:
[0065]
[0066] where is the true preference probability of user u for point of interest l i When user u arrives at point of interest l i otherwise λ θ is the l2 regularization weight, and θ is the set of training parameters.
[0067] An interest point recommendation device based on trajectory semantics and attention preferences, comprising: a processor and a storage medium; the processor loads and executes instructions and data in the storage medium to implement the interest point recommendation method based on trajectory semantics and attention preferences.
[0068] The present invention has the following beneficial effects:
[0069] 1. During the feature embedding process through the embedding set, different features of the user check-in data are jointly modeled, including features in multiple dimensions such as location embedding, time embedding, frequency embedding, and semantic embedding. Specifically, each record item of the check-in data will be mapped into a high-dimensional vector representation, integrating the context information of the check-in point and capturing the user's behavior pattern. In particular, the Time2Vec encoding method is adopted to enhance the expression ability of time series features, and the BiLSTM structure is used to learn the temporal dependence of the check-in trajectory. This multi-dimensional feature expression method enhances the model's understanding of user behavior and makes the recommendation more accurate;
[0070] 2. An attention preference integration module is introduced into the interest point recommendation model to capture the complex relationships in the check-in point sequence, especially the correlation between different check-in points. The self-attention module can measure the influence of the interaction before and after check-in, ensuring that the model not only focuses on local information but also can effectively learn the check-in history and long-term preferences. In addition, by calculating the similarity between check-in trajectories, the model can identify user groups with similar behavior patterns and perform personalized recommendations in combination with the preferences of the target user. This method improves the accuracy of the recommendation results, makes the personalized recommendation more accurate, and can adapt to the dynamically changing user needs;
[0071] 3. A trajectory semantic representation module is introduced into the interest point recommendation model to overcome the information loss problem caused by the trajectory length, and the attention mechanism is used to combine personalized preferences and group collaboration signals to balance the diversity and personalization of the recommendation, so as to effectively improve the accuracy of the interest point recommendation and enhance the adaptability and generalization ability of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] Figure 1 is the flowchart of the method of the embodiment of the present invention;
[0073] Figure 2 is the working flowchart of the interest point recommendation model;
[0074] The realization, functional features and advantages of the object of the present invention will be further described in conjunction with the embodiments with reference to the drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0075] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0076] Reference Figure 1 - Figure 2 , the present invention provides a method for recommending points of interest based on trajectory semantics and attention preferences, including the steps of:
[0077] S1: Obtain the check-in record data set of user u, preprocess the check-in record data set to obtain the original trajectory;
[0078] As an embodiment, all check-in records of a group of users are obtained from a location-based social network (LBSN), and each check-in record contains at least five check-in record information: user, point of interest, longitude and latitude of the point of interest, category of the point of interest, and check-in timestamp.
[0079] Perform the following data preprocessing on the obtained all check-in records: delete the invalid check-in records with missing check-in record information, discard the historical check-in records with only one occurrence, and the check-in records of points of interest that appear less than five times in the entire check-in sequence. After the above steps, the check-in data that can be used for experiments is obtained.
[0080] For the user set and the location set L, we train two embedding functions to distinguish the general behavior of each specific user while discerning the spatial location distribution of any given point of interest l ∈ L.
[0081] Original trajectory The expression is: Where, is the location of the nth point of interest;
[0082] The embedding set includes: user embedding e u , point of interest embedding e i , semantic embedding e s , time embedding e t , time-aware category embedding e C , time interval embedding e Δt and spatial interval embedding e Δd .
[0083] S2: Calculate the embedding set through the original trajectory, and calculate the joint feature matrix M J and the explicit feature matrix M E ;
[0084] As an embodiment:
[0085] Step S2 is specifically:
[0086] S21: Obtain all points of interest through the original trajectory of user u, and construct a point of interest set L through each point of interest;
[0087] S22: Calculate to obtain the user embedding e u and the point-of-interest embedding e i , and the calculation formula is:
[0088]
[0089] where l i represents the i-th point of interest, l i ∈L, and F embed () represents an embedding function that maps a given entity to a fixed-dimensional vector space;
[0090] S23: Obtain the attribute d s of the point of interest and the time t through the original trajectory, perform semantic scoring on the attribute d s through a pointwise feed-forward neural network to obtain the semantic embedding e s ; capture the cross-category access periodicity of the time t through Time2Vec encoding to obtain the time embedding e t ; integrate the semantic embedding e s and the time embedding e t to obtain the time-aware category embedding e C ;
[0091] Specifically, summarize the d s attributes of the point of interest (such as consumption, entertainment, learning, etc.), and then use a pointwise feed-forward neural network (FNN) to perform semantic scoring on these attributes to obtain a vector representation that corresponds to the semantic features of the point-of-interest category;
[0092] Use the Time2Vec encoding scheme to capture the cross-category access periodicity, and integrate and the semantic embedding e s into the model to obtain the final time-aware category embedding e C to capture the temporal pattern of user activities.
[0093]
[0094] where e t is the time embedding and e s is the semantic embedding;
[0095] S24: Obtain the time interval Δt and the space interval Δd through the original trajectory, construct the time-aware parameter matrix W T and the distance-aware parameter matrix W D , calculate to obtain the time interval embedding e Δt and the space interval embedding e Δd , and the calculation formula is:
[0096]
[0097] Among them, λ represents the time decay rate, reflecting the weight of the influence of the time interval, and T is the transpose symbol;
[0098] Specifically, construct matrices and to encode the time and space intervals respectively. The matrix element Δt i,j = |t j - t i | and Δd i,j = |d j - d i | represent the explicit time and space intervals between records r i and r j . A periodic normalization function p(x) is designed to obtain the dense vector representation of these two explicit interval matrices.
[0099]
[0100] Use the time exponential decay rate to represent that the correlation in the check-in record decreases with the increase of the time interval. Apply a trainable time-aware parameter matrix W T to obtain the embedding vector e Δt for each Δt. Adopt a trainable distance-aware parameter matrix W D to obtain the embedding vector e Δd for each Δd;
[0101] S25: Project the original trajectory into the joint feature matrix M u through the user embedding e i and the point-of-interest embedding e J ;
[0102] Specifically, each v in the joint feature matrix i is a d-dimensional vector encapsulating semantic features;
[0103] S26: Perform dense vector representations on the time interval embedding e Δt and the space interval embedding e Δd respectively to obtain the time interval dense vector M Δt and the space interval dense vector M Δd ;
[0104] S27: Perform weighted aggregation on the time interval dense vector M Δt and the space interval dense vector M Δd to obtain the explicit feature matrix M E .
[0105] Specifically, the dense vector representations of the two explicit interval matrices are and Apply weighted aggregation on the last dimension of two representation matrices to obtain an explicit feature matrix To reflect the joint spatio-temporal context-aware interaction of the check-in trajectories.
[0106] S3: Build a point-of-interest recommendation model through the joint feature matrix M J and the explicit feature matrix M E Train the point-of-interest recommendation model to obtain a trained point-of-interest recommendation model;
[0107] As an example:
[0108] The point-of-interest recommendation model includes: a trajectory semantic representation module, an attention preference integration module, and a user preference matching module;
[0109] The trajectory semantic representation module and the attention preference integration module are connected to the user preference matching module.
[0110] As an example:
[0111] Step S3 is specifically:
[0112] S31: Input the joint feature matrix M of user u J into the trajectory semantic representation module, and obtain a hidden feature matrix by capturing the past and future context of where, is the forward hidden state vector, is the backward hidden state vector; where T is the transpose symbol;
[0113] Specifically, is processed by a BiLSTM to learn the dependencies between adjacent check-in points within the trajectory, and the resulting forward and backward hidden state vectors are respectively and where h is the dimension size, and they provide a comprehensive representation of the trajectory by capturing the past and future context. These hidden state matrices and are both of, and they are combined into a hidden feature matrix This matrix reflects the temporal correlation of each check-in point within the trajectory;
[0114]
[0115] where v i is a d-dimensional vector encapsulating semantic features;
[0116] S32: Build a check-in frequency matrix MF where the element f ui represents the frequency of user u visiting the point of interest l i ; the check-in frequency matrix M is enhanced by the trajectory semantics representation module F to obtain the enhanced check-in frequency matrix M' F ;
[0117] Specifically, a check-in frequency matrix is constructed where each element f ui represents the frequency of user u visiting location l i . To compress M while retaining the sequential dependence pattern between different locations F , by applying BiLSTM to M F , an enhanced frequency matrix is obtained
[0118] S33: The latent feature matrix M H is calculated from the hidden feature matrix M F and the enhanced check-in frequency matrix M' L , and the calculation formula is:
[0119] M L = softmax(Q u ⊙tanh(M′ F ×M H ))
[0120] where Q u is a training parameter and can be interpreted as the query matrix of M H . ⊙ represents dot product attention, and softmax() represents the normalized exponential function. softmax(·) ensures that the sum of all attention weights between Q u and K u is equal to one;
[0121] The latent feature matrix M L is subjected to ReLU transformation dot product attention with to obtain the semantic representation matrix of user u
[0122] Specifically, M H is a triple composite semantic matrix that combines the user identity e F using the enhanced frequency matrix M' H and the hidden feature matrix M u , the point of interest location e l , and the time-aware category embedding information e c . Then M H is combined with the enhanced frequency matrix M' F to obtain This matrix takes into account the personalized preferences of each user. K u Combined with the personalized frequency and sequence dependence from historical trajectories, a latent feature matrix is obtained, denoted as M L ;
[0123] By learning a latent feature matrix Taking the ReLU-transformed dot product attention between it and the transposed a length-independent representation matrix can be obtained This matrix encapsulates rich semantic information and depicts the potential relationships between points of interest within the complete check-in trajectory;
[0124] S34: Input the latent feature matrix M L and the explicit feature matrix M E into the attention preference integration module to construct the head attention. The expression of the head attention is:
[0125]
[0126] where head j is the j-th head attention, and (all in ) are the Query, Key, and Value weight parameter matrices of the j-th head attention respectively, and T is the transpose symbol;
[0127] Specifically, calculate the multi-head matrix representation of the latent feature matrix , where the matrices Q, K, and V are generated, corresponding to the Query, Key, and Value components of each head in the attention mechanism. Subsequently, an explicit feature matrix M E is combined to provide additional contextual spatio-temporal information for the model. This matrix helps to aggregate specific patterns such as time and space intervals;
[0128] To avoid the dot product of Q and from being too large and to control and the explicit feature matrix within a reasonable range, choose except to improve stability. Then, apply the softmax operation to the scaled dot product and convert it into an attention weight distribution. This distribution is used to perform a weighted sum on the Value matrix . It represents the attention probability of each potential candidate point of interest under all visited locations. During the training process, by adjusting the matrix M E , the proposed model can be guided to incorporate explicit spatio-temporal relationships into the interaction of self-attention aggregation.
[0129]
[0130] S35: Obtain the attention head feature H through the calculation of each head attention A , and the calculation formula is:
[0131]
[0132] where n h is the total number of head attentions, Concat() represents the concatenation function, and W O is the output weight matrix;
[0133] Specifically, each is linearly combined through the output weight matrix to obtain the attention head feature
[0134] Through the attention head feature H A calculate to obtain the self-attention aggregation matrix M A , and the calculation formula is:
[0135] M A = Dropout(LayerNorm(H A ))
[0136] where LayerNorm() represents the layer normalization operation, and Dropout() represents the execution of the Dropout operation;
[0137] Specifically, perform the Dropout and layer normalization operations on H A to receive the final self-attention aggregation matrix M A , which can reflect the implicit relationship between the historical locations visited and the potential candidate points of interest;
[0138] S36: Calculate the total cosine similarity between user u and the other most similar users, and obtain the predicted scoring probability of user u for the point of interest l i through each total cosine similarity
[0139] Specifically, let and represent the trajectory representation matrices of user u and v respectively, and the dimensions of both are q×2h:
[0140] In step S36:
[0141] The total cosine similarity between user u and user v is calculated as follows:
[0142]
[0143] Among them, represents the k-th row vector of matrix , represents the k-th row vector of matrix , and ||·|| represents the Euclidean norm;
[0144] Predicted scoring probability The calculation formula is:
[0145]
[0146] Among them, N(u) represents the set of users most similar to user u, represents the scoring probability of user v for point of interest l i .
[0147] Specifically, the summation calculates the total cosine similarity between the corresponding row vectors of two user trajectory matrices. A larger Sim value indicates a higher similarity between the trajectories. For target user u, k users with the most similar mentalities are found according to the cosine similarity to predict their scoring probability for point of interest l i .
[0148] S37: For user u, construct the point of interest embedding matrix E L through all the point of interest embeddings, and calculate and obtain the point of interest probability score set A through the self-attention aggregation matrix M L and the point of interest embedding matrix E The calculation formula is:
[0149]
[0150] Among them, WeightAgg() represents weighted aggregation;
[0151] Specifically, apply weighted aggregation on the last dimension of and convert its dimension to to reflect the influence of n historical check-ins on L candidate locations. Each value represents the predicted score of user u for point of interest l i based on the user's own trajectory characteristics;
[0152] S38: Calculate and obtain the predicted preference probability of user u for point of interest l through the predicted scoring probability i and the point of interest probability score set The calculation formula is:
[0153]
[0154] Among them, Fusion() represents a feed-forward neural network activated by softmax, is the probability score of the point of interest l i ; and are learning weights;
[0155] Specifically, considering that is mainly affected by the user's historical access behavior and patterns (i.e., preference basis), while emphasizes more on the collective characteristics among users with similar mindsets. In order to achieve more accurate and diverse personalized point-of-interest recommendations, weighted fusion is performed to balance these two aspects;
[0156] The weights and learned from the fusion function are variable for different users u to ensure adaptive personalized recommendations. In addition, for inactive users, a larger
[0157] S39: Repeat step S38 until the predicted preference probabilities of all points of interest are obtained, and the cross-entropy loss is calculated through the predicted preference probabilities of all points of interest
[0158] Specifically, using the cross-entropy loss, optimize all trainable parameters θ = {W * , b * , d *}, and combine regularization to alleviate overfitting;
[0159] In step S39:
[0160] The cross-entropy loss is calculated as follows:
[0161]
[0162] Among them, is the true preference probability of user u for point of interest l i , when user u arrives at point of interest l i ; otherwise λ θ is the l2 regularization weight, and θ is the set of training parameters.
[0163] S310: Repeat steps S31 - S39 until the cross-entropy loss is less than the preset value, and the trained point-of-interest recommendation model is obtained.
[0164] S4: Calculate and obtain a set of preference probabilities through the trained point-of-interest recommendation model, and recommend points of interest to user u based on the set of preference probabilities.
[0165] Specifically, through the implementation of this method, the model has achieved remarkable results in trajectory recommendation and personalized recommendation. Through multi-dimensional feature embedding, check-in data is efficiently transformed into a high-dimensional representation containing information such as location, time, frequency, and semantics, enhancing the model's ability to understand user behavior patterns and making the recommendation more accurate. By adopting the Time2Vec encoding combined with the BiLSTM structure, the temporal dependence relationship of the check-in trajectory is effectively captured, improving the modeling ability of user behavior patterns and enhancing the learning ability of long-term preferences. In addition, the self-attention mechanism is introduced, enabling the model to learn the complex relationships between check-in points, not only paying attention to local interactions but also combining global information to optimize the recommendation effect and improving the intelligence and adaptability of the recommendation. At the same time, through the calculation of check-in trajectory similarity in the solution, user groups with similar behavior patterns can be identified, so as to more accurately predict the potential interests of users during the personalized recommendation process. By introducing trajectory-level collaborative information capture, the model can better depict the interaction relationship between users and check-in points, making the recommendation results more reasonable and adaptable to the dynamic changes of user behavior. Overall, this solution significantly improves the accuracy, stability, and generalization ability of trajectory recommendation, enabling the system to meet the needs of different user groups and provide efficient and accurate personalized recommendation services in complex and ever-changing real scenarios.
[0166] A point-of-interest recommendation device based on trajectory semantics and attention preferences, comprising: a processor and a storage medium; the processor loads and executes instructions and data in the storage medium to implement the point-of-interest recommendation method based on trajectory semantics and attention preferences.
[0167] It should be noted that in this article, the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements not only includes those elements but also includes other elements not explicitly listed, or further includes elements inherent to such a process, method, article or system. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of another identical element in the process, method, article or system including that element.
[0168] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments. Among the several unit claims listing several devices, several of these devices can be specifically embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order and these words can be interpreted as identifiers.
[0169] The above are only the preferred embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be similarly included in the patent protection scope of the present invention.
Claims
1. A method for recommending points of interest based on trajectory semantics and attention preferences, characterized in that Including the steps: S1: Obtain the check-in record data set of user u, preprocess the check-in record data set, and obtain the original trajectory; S2: Obtain the embedding set through the calculation of the original trajectory, and obtain the joint feature matrix M through the calculation of the embedding set J and the explicit feature matrix M E ; S3: Build a point-of-interest recommendation model by jointly using the feature matrix M J and the explicit feature matrix M E to train the point-of-interest recommendation model and obtain a trained point-of-interest recommendation model; S4: Calculate and obtain the preference probability set through the trained point-of-interest recommendation model, and recommend points of interest to user u through the preference probability set.
2. The method for recommending points of interest based on trajectory semantics and attention preference according to claim 1, wherein: Original trajectory The expression of is as follows: where is the position of the nth point of interest; The embedding set includes: user embedding e u , point-of-interest embedding e i , semantic embedding e s , time embedding e t , time-aware category embedding e C , time interval embedding e Δt and spatial interval embedding e Δd .
3. The method for recommending points of interest based on trajectory semantics and attention preferences according to claim 2, wherein Step S2 is specifically: S21: Obtain all points of interest through the original trajectory of user u, and construct a set of points of interest L through each point of interest; S22: Calculate to obtain the user embedding e u and the point of interest embedding e i , and the calculation formula is: Among them, l i represents the i-th point of interest, l i ∈L, F embed () represents an embedding function that maps a given entity to a fixed-dimensional vector space; S23: Obtain the attribute d of the point of interest from the original trajectory s and the time t, and perform semantic scoring on the attribute d s through a point-by-point feedforward neural network to obtain the semantic embedding e s ; Capture the cross-category access periodicity of the time t through Time2Vec encoding to obtain the time embedding e t ; Integrate the semantic embedding e s and the time embedding e t to obtain the time-aware category embedding e C ; S24: Obtain the time interval Δt and the spatial interval Δd from the original trajectory, and construct the time perception parameter matrix W T and the distance perception parameter matrix W D , calculate to obtain the time interval embedding e Δt and the spatial interval embedding e Δd , and the calculation formula is: wherein, λ represents the time decay rate, and T is the transpose symbol; S25: Project the original trajectory into a joint feature matrix M by embedding the user e u and the point of interest embedding e i ; J ; S26: Embed the time interval into e Δt and embed the space interval into e Δd respectively perform dense vector representation to obtain the time interval dense vector M Δt and the space interval dense vector M Δd ; S27: Weightedly aggregate the time interval dense vector M Δt and the space interval dense vector M Δd to obtain the explicit feature matrix M E .
4. The method for recommending points of interest based on trajectory semantics and attention preference according to claim 1, wherein: The point-of-interest recommendation model includes: a trajectory semantic representation module, an attention preference integration module, and a user preference matching module; The trajectory semantic representation module and the attention preference integration module are connected to the user preference matching module.
5. The method for recommending points of interest based on trajectory semantics and attention preference according to claim 4, wherein Step S3 is specifically: S31: Input the combined feature matrix M of user u J into the trajectory semantic representation module, and obtain the hidden feature matrix by capturing the past and future context where is the forward hidden state vector, is the backward hidden state vector; where T is the transpose symbol; S32: Construct a check-in frequency matrix M F , where the element f ui represents the frequency of user u visiting the point of interest l i ; Enhance the check-in frequency matrix M F through the trajectory semantic representation module to obtain an enhanced check-in frequency matrix M' F ; S33: Obtain the latent feature matrix M by hiding the feature matrix M H and enhancing the check-in frequency matrix M' F The latent feature matrix M is calculated as follows: L The calculation formula is: Among them, Q u is a training parameter, ⊙ represents dot product attention, and softmax() represents the normalized exponential function; Perform ReLU transformation dot product attention on the latent feature matrix M L and to obtain the semantic representation matrix of user u S34: Input the latent feature matrix M L and the explicit feature matrix M E into the attention preference integration module to construct the head attention, and the expression of the head attention is: Among them, head j is the j-th head attention, and are the Query, Key, and Value weight parameter matrices of the j-th head attention respectively, and T is the transpose symbol; S35: Obtain the attention head feature H through the calculation of each head attention A , and the calculation formula is: where n h is the total number of head attentions, Concat() represents the concatenation function, and W O is the output weight matrix; Through the attention head feature H A Calculate to obtain the self-attention aggregation matrix M A , and the calculation formula is: M A = Dropout(LayerNorm(H A )) wherein, LayerNorm() represents the layer normalization operation, and Dropout() represents the execution of the Dropout operation; S36: Calculate the total cosine similarity between user u and the other most similar users, and calculate the predicted rating probability of user u for point of interest l i through each total cosine similarity S37: For user u, construct a point of interest embedding matrix E through all point of interest embeddings L , and calculate the point of interest probability score set through the self-attention aggregation matrix M A and the point of interest embedding matrix E L . The calculation formula is as follows: The calculation formula is: wherein, WeightAgg() represents weighted aggregation; S38: By predicting the scoring probability and the set of point-of-interest probability scores calculate to obtain the predicted preference probability of user u for point of interest l i The calculation formula is as follows: The calculation formula is: Among them, Fusion() represents a feedforward neural network activated by softmax, is the interest point l i the interest point probability score of, and are learning weights; S39: Repeat step S38 until the predicted preference probabilities of all points of interest are obtained, and calculate the cross-entropy loss based on the predicted preference probabilities of all points of interest ; S310: Repeat steps S31 - S39 until the cross - entropy loss is less than a preset value to obtain a trained point - of - interest recommendation model.
6. The method for recommending points of interest based on trajectory semantics and attention preference according to claim 5, characterized in that In step S36: The total cosine similarity between user u and user v The calculation formula is as follows: Among them, represents the k-th row vector of the matrix , represents the k-th row vector of the matrix , and ||·|| represents the Euclidean norm; Predicted scoring probability The calculation formula is as follows: Among them, N(u) represents the set of users most similar to user u. represents the rating probability of user v for the point of interest l i 7. The method for recommending points of interest based on trajectory semantics and attention preference according to claim 5, wherein In step S39: Cross-entropy loss The calculation formula is as follows: where, is the true preference probability of user u for point of interest l i when user u arrives at point of interest l i at that time otherwise λ θ is the l2 regularization weight, and θ is the set of training parameters.
8. An interest point recommendation device based on trajectory semantics and attention preference, characterized in that: Including: A processor and a storage medium; the processor loads and executes the instructions and data in the storage medium to implement the method for recommending points of interest based on trajectory semantics and attention preference according to any one of claims 1 to 7.
Citation Information
Cited By
Multi-task interest point recommendation method based on multiple modes and time perception
CN121301672A