Next interest point recommendation method for decoupling long-term and short-term preferences
Through the combination of the extraction module and the self-supervised decoupling module, the problems of long-term and short-term preference entanglement and data sparseness are solved, the accuracy and robustness of the next point of interest recommendation are improved, and the effective use of coarse-grained information is achieved.
Patent Information
- Application Number
- CN202410636766.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-22
- Publication Date
- 2024-09-03
AI Technical Summary
Existing next point of interest recommendation methods have entanglement and data sparse problems when dealing with long- and short-term preferences, resulting in limited recommendation accuracy and failure to fully utilize coarse-grained information.
It uses the long-term and short-term preference extraction module, the user activity pattern extraction module, the preference enhancement module and the preference self-supervised decoupling module to capture long-term and short-term preferences respectively through the bidirectional Transformer encoder and LSTM encoder, and uses the attention layer and contrastive learning to perform preference Representation augmentation and decoupling, combined with user activity patterns to improve recommendation accuracy.
It achieves accurate decoupling of long-term and short-term preferences, improves the accuracy and robustness of the recommendation system, alleviates the problem of sparse check-in data, and enhances the utilization of coarse-grained information.
Smart Images

Figure CN118585701A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data mining, and in particular to a next point of interest recommendation method that decouples long-term and short-term preferences. Background Art
[0002] As an effective tool to solve information overload, the recommendation system has attracted extensive attention from researchers. In recent years, the booming development of location-based social networks has led to the accumulation of a large amount of spatiotemporal data, which has spawned a new subfield in the recommendation system that utilizes these spatiotemporal data: the next point of interest recommendation. Research in this field not only benefits users during their mobile experience through personalized experience, but also enables related service providers to profit.
[0003] In the next area of POI recommendation, we can divide user preferences into long-term preferences and short-term preferences. Long-term preferences are stable and have periodic characteristics, while short-term preferences change with the change of context.
[0004] It is observed that modeling both long-term and short-term preferences can improve the accuracy of the next POI recommendation. Some existing works have modeled both long-term and short-term user preferences and achieved significant performance improvements. However, these works do not fully address the following two issues: 1) Long-term and short-term preferences are entangled with each other. In the existing check-in dataset, there is a lack of label data to distinguish long-term and short-term interests. Therefore, the long-term and short-term preferences modeled by the existing methods may be entangled with each other, that is, the existing methods cannot mine accurate long-term and short-term user preferences, further affecting the accuracy of recommendations; 2) Check-in data is sparse. In the existing check-in dataset, there is an established fact that the number of POIs visited by a single user is much smaller than the number of existing POIs. Therefore, the check-in data is very sparse. Existing methods mainly capture users' long-term and short-term preferences from a fine-grained perspective, and fail to fully utilize the coarse-grained information in sparse check-ins (such as category preferences and regional preferences) to enhance the learning of users' long-term and short-term preferences. Summary of the invention
[0005] The purpose of the present invention is to provide a next point of interest recommendation method that decouples long-term and short-term preferences, so that it can not only decouple users' long-term and short-term preferences, obtain accurate long-term and short-term preference representations, and improve the accuracy of recommendations, but also utilize coarse-grained information to enhance the learning of long-term and short-term preference representations and alleviate the problem of sparse sign-in data.
[0006] A next point of interest recommendation method for decoupling long-term and short-term preferences includes a long-term and short-term preference extraction module, a user activity pattern extraction module, a preference enhancement module, a preference self-supervision decoupling module, and a recommendation prediction module.
[0007] The long-term and short-term preference extraction module first extracts the user's long-term trajectory Perform masking to obtain masked long-term trajectory Then randomly generate mask long-term trajectories Short-term trajectory The low-dimensional vector representation of Then, two independent bidirectional Transformer encoders are used to and Capturing users’ periodic long-term preferences u,l and user dynamic short-term preferences u,s ,The two preferences are then passed to the preference enhancement module.
[0008] The user activity pattern extraction module first randomly generates the user's category trajectory Q u The low-dimensional vector representation of Then it is passed to the LSTM encoder to obtain the category preference H c . Then the next point of interest check-in time x t As the query vector, H c As key vectors and value vectors, the temporal attention layer is used to extract the user activity pattern c u , and transmit it to the preference enhancement module.
[0009] The preference enhancement module converts the user activity pattern c u As the query vector, e u,l As the key vector and value vector, the input attention layer obtains the enhanced long-term preference e u,l ; Similarly, the user activity pattern c u As the query vector, e u,s As the key vector and value vector, the short-term preference e after the representation enhancement is passed into the attention layer u,s . Then the long-term and short-term preferences e u,l 、e u,s Transferred to the preference self-supervised decoupling module.
[0010] The preference self-supervised decoupling module extracts the user's long-term trajectory from Obtain the preference proxy p corresponding to the long-term preference u,l , from the user's short-term trajectory Get the preference proxy p corresponding to the short-term preference u,s Then, p u,l and p u,s As a self-supervisory signal, it can represent the long-term and short-term preference u,l 、e u,s With preference proxy p u,l 、p u,s By using contrastive learning and designing four contrast tasks, the long-term and short-term preferences are self-supervised and decoupled. u,l 、eu,s Transmitted to the recommendation prediction module.
[0011] The recommendation prediction module first obtains the user's final preference h based on the attention fusion of the user's long-term and short-term preferences. u , and then use the user's final preference h through the activation function u Predict the points of interest that the user may visit next and send them to the user.
[0012] Furthermore, the long-term and short-term preference extraction module obtains the user's long-term and short-term preferences u,l and e u,s The steps include:
[0013] 1) Randomly mask the user's long-term trajectory to obtain the masked long-term trajectory Then, a standard normal distribution is used to randomly generate a low-dimensional vector representation of the long-term trajectory of the mask and short-term trajectory The low-dimensional vector representation of Where n and m represent the lengths of the long and short-term trajectories, respectively, i.e., n and m are the number of check-in behaviors contained in the long and short-term trajectories, respectively; d is the embedding size of the context information (such as POI category, time, POI, etc.) contained in a check-in behavior, and 5d is the sum of the embedding sizes of all contexts of the check-in;
[0014] 2) The i-th trajectory in the user's long-term trajectory Input to the Transformer encoder as the initial input of layer 0, expressed as k represents the current trajectory The length of . Let the bidirectional Transformer encoder iterate l times, where the output of the encoder layer l can be expressed as Indicates that during the iteration, the output of the encoder layer l-1 will be used as the input of the layer l;
[0015] Among them, in the lth layer, the vector It will be input into a multi-head attention layer containing N attention heads. Specifically, the output of the first attention head in layer l is as follows:
[0016]
[0017] Where softmax(*) is a normalized exponential function; W Q , W K and is the learnable weight matrix associated with the query vector, key vector, and value vector in the first attention head of layer l in the Transformer encoder,
[0018] Then, the outputs of these N attention heads are stacked up using a linear layer to obtain the output Z of the multi-head attention layer. l -1′ , the specific calculation formula is as follows:
[0019]
[0020] in Represents a trainable weight matrix.
[0021] Then, in the original input Z l-1 And the output Z l-1′ Residual connections are made between them, and the final output of the multi-head attention layer is obtained through layer regularization and dropout regularization. The specific calculation is as follows:
[0022]
[0023] In the formula, LayerNorm(*) represents an L1 regularization function, and Dropout(*) represents a dropout regularization operation. Then, the final output of the multi-head attention layer is processed through the fully connected layer. To convert, the specific calculation is as follows:
[0024]
[0025] In the formula, ReLU(*) is an activation function; Respectively represent the learnable weight parameter matrix in the fully connected layer, They are The bias of the weight matrix. Finally, the final output of the multi-head attention layer And the output of the fully connected layer Residual connections are made between them, and the dropout regularization operation is used to obtain the final output Z of the lth layer l , the specific calculation is as follows:
[0026]
[0027] Where LayerNorm(*) represents an L2 regularization function, and Dropout(*) represents a dropout regularization operation.
[0028] Encoding all long-term trajectories Afterwards, the long-term preference is obtained through aggregation and average pooling operations Where Mean(*) represents the average pooling operation, and [·;·] represents the aggregation operation.
[0029] A Tran(*) function is used to represent the operations (1), (2), (3), (4), and (5) involved in the Transformer encoder.
[0030] 3) The user's short-term trajectory Input to the Transformer encoder as the initial input of layer 0, expressed as Let the bidirectional Transformer encoder iterate l times, where the output of the encoder layer l can be expressed as In the iterative process, the output of the encoder layer l-1 will be used as the input of the l layer. Finally, the output Z of the l layer l The vector obtained by average pooling is used as the short-term preference The specific calculation formula is as follows:
[0031]
[0032] Where Mean(*) represents the average pooling operation and Tran(*) represents the bidirectional Transformer encoder.
[0033] The user activity pattern extraction module obtains the user activity pattern c u The steps include:
[0034] 1) Use standard normal distribution to randomly generate user category trajectories The low-dimensional vector representation of Where n and m represent the lengths of long and short-term trajectories, respectively, d is the embedding size of the context information (such as category) contained in a category check-in, and 3d is the sum of all context embedding sizes of the category check-in;
[0035] 2) The i-th track in the user's category track Input to the LSTM encoder as the initial input of layer 0, expressed as i′ represents the length of the current category trajectory. Let the LSTM encoder iterate l times, where the output of the encoder layer l can be expressed as Indicates that during the iteration, the output of the encoder layer l-1 will be used as the input of the layer l. Finally, the output Z of the layer l l As the output of this trajectory, the specific calculation is:
[0036]
[0037] Among them, LSTM (*) represents LSTM encoder. Afterwards, the category preference is obtained through simple aggregation and average pooling operations Where Mean(*) represents the average pooling operation, and [·;·] represents the aggregation operation.
[0038] 3) Set the time x for the next point of interest check-in t As the query vector, H c As the key vector and value vector, we use the temporal attention layer to obtain the user activity pattern c u , the specific calculation is as follows:
[0039]
[0040] Attention(Q,K,V)=sum((softmax(Q*K T ))*V) (9)
[0041] In the formula, Attention(*) represents an attention layer, sum(*) represents a summation operation, and softmax(*) represents an activation function.
[0042] The steps of using user activity patterns to enhance the representation of long-term and short-term preferences include:
[0043] Set user activity mode c u As the query vector, e u,l As the key vector and value vector, the attention mechanism is used to obtain the long-term preference e after representation enhancement u,l , the specific calculation formula is as follows:
[0044]
[0045] Attention(Q,K,V)=sum((softmax(Q*K T ))*V) (11)
[0046] In the formula, Attention(*) represents an attention layer, sum(*) represents a summation operation, and softmax(*) represents an activation function. Similarly, c u As the query vector, e u,s As the key vector and value vector, the short-term preference after representation enhancement is obtained based on the attention mechanism.
[0047] The preference self-supervision decoupling module decouples long-term and short-term preferences. u,l and e u,s The steps include:
[0048] 1) From the long-term trajectory of users and short-term trajectory The corresponding preference proxy (i.e. preference label) is obtained from , and the specific calculation formula is as follows:
[0049]
[0050]
[0051] In the formula, represents a check-in behavior in a long-term trajectory, Represents a check-in behavior in a short-term trajectory, and Mean(*) represents the average pooling operation.
[0052] 2) In the long-term and short-term preference representation u,l 、e u,s With preference proxy P u,l , P u,s By using contrastive learning, four contrastive tasks are designed. The contrastive tasks are as follows:
[0053] sin(e u,l ,P u,l )>sim(e u,l ,P u,s ) (14)
[0054] sim(P u,l ,e u,l )>sim(P u,l ,e u,s ) (15)
[0055] sin(e u,s ,P u,s )>sim(e u,s ,P u,l ) (16)
[0056] sim(P u,s ,e u,s )>sim(P u,s ,e u,l ) (17)
[0057] In the formula, sim(*) represents a similarity calculation function, which is used to calculate the similarity between vectors, so that formulas (14)-(15) can supervise long-term preferences, and formulas (16)-(17) can supervise short-term preferences, thereby realizing the decoupling of long-term and short-term preferences, and obtaining the decoupled long-term and short-term preferences e u,l 、e u,s .
[0058] The steps of the recommendation prediction module to predict the points of interest that the user may visit next include:
[0059] 1) Use the attention mechanism to integrate users’ long-term and short-term preferences u,l 、e u,s Get the user's final preference hu , the specific calculation is as follows:
[0060]
[0061] Attention(Q,K,V)=sum((softmax(Q*K T ))*V) (19)
[0062] In the formula, x u is the low-dimensional vector representation of the current user, “||” represents a concatenation operation, Attention(*) represents an attention layer, sum(*) represents a summation operation, and Softmax(*) represents an activation function.
[0063] 2) Using the user's final preference h through the activation function u Predict the points of interest that the user may visit next. The specific calculation is as follows:
[0064]
[0065] In the formula, represents the probability distribution of the points of interest that the user may visit next, and |k| represents the number of points of interest in the dataset; represents a trainable parameter matrix; softmax(*) is an activation function. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] Figure 1 It is the overall framework of the model of the present invention.
[0067] Figure 2 Experimental results analyzed for the invented model components; Figure 2 (a) is the experimental result of the PHO dataset on the evaluation index HR@5; Figure 2 (b) is the experimental result of the PHO dataset on the evaluation index NDCG@5; Figure 2 (c) is the experimental result of the NYC dataset on the evaluation index HR@5; Figure 2 (d) is the experimental results of the NYC dataset on the evaluation indicator NDCG@5.
[0068] Figure 3 Visualization results for decoupling long-term and short-term preferences; Figure 3 (a) is the undecoupled long-term and short-term preferences on the NYC dataset; Figure 3 (b) Decoupled long-term and short-term preferences on the NYC dataset; Figure 3 (c) is the undecoupled long-term and short-term preferences on the dataset SIN; Figure 3 (d) Decoupled long-term and short-term preferences on the dataset SIN. DETAILED DESCRIPTION
[0069] The present invention is further described below in conjunction with the embodiments, but it should not be understood that the above subject matter of the present invention is limited to the following embodiments. Without departing from the above technical ideas of the present invention, various substitutions and changes are made according to the common technical knowledge and customary means in the art, which should all be included in the protection scope of the present invention.
[0070] Embodiment 1:
[0071] See also Figure 1 ,The next POI recommendation method that decouples long-term and short-term preferences includes a long-term and short-term preference extraction module, a user activity pattern extraction module, a preference enhancement module, a preference self-supervision decoupling module, and a recommendation prediction module.
[0072] The long-term and short-term preference extraction module randomly generates low-dimensional vector representations of masked long-term and short-term trajectories Then, two independent bidirectional Transformer encoders are used to and Capturing users’ periodic long-term preferences u,l and user dynamic short-term preferences u,s ,The two preferences are then passed to the preference enhancement module.
[0073] The user activity pattern extraction module first randomly generates a category trajectory Q u The low-dimensional vector representation of Then it is passed to the LSTM encoder to obtain the category preference H c . Then the next point of interest check-in time x t As the query vector, H c As key vectors and value vectors, the temporal attention layer is used to extract the user activity pattern c u , and transmit it to the preference enhancement module.
[0074] The preference enhancement module converts the user activity pattern c u As the query vector, e u,l As the key vector and value vector, the input attention layer obtains the enhanced long-term preference e u,l ; Similarly, the user activity pattern c u As the query vector, e u,s As the key vector and value vector, the input to the attention layer is the user’s short-term preference e after characterization enhancement. u,s . Then the long-term and short-term preferences e u,l 、e u,s Transferred to the preference self-supervised decoupling module.
[0075] The preference self-supervised decoupling module is respectively derived from the long-term trajectory Obtain the preference proxy p corresponding to the long-term preference u,l , from the short-term trajectory Get the preference proxy p corresponding to the short-term preference u,s Then, p u,l and p u,s As a self-supervisory signal, it can represent the long-term and short-term preference u,l 、e u,s With preference proxy p u,l 、p u,s By using contrastive learning and designing four contrast tasks, the long-term and short-term preferences are self-supervised and decoupled. u,l 、e u,s Transmitted to the recommendation prediction module.
[0076] The recommendation prediction module first obtains the user's final preference h based on attention fusion of long-term and short-term preferences. u , and then use the user's final preference h through the activation function u Predict the points of interest that the user may visit next and send the predicted points of interest to the user.
[0077] Specifically, the long-term and short-term preference extraction module obtains the user's long-term and short-term preferences u,l and e u,s The steps include:
[0078] 1) Randomly mask the user's long-term trajectory to obtain the masked user's long-term trajectory Then, a standard normal distribution is used to randomly generate a low-dimensional vector representation of the long-term trajectory of the mask and short-term trajectory The low-dimensional vector representation of Where n and m represent the lengths of the long and short-term trajectories, respectively, that is, n and m are the number of check-in behaviors contained in the long and short-term trajectories, respectively; d is the embedding size of the context information (such as POI category, time, POI, etc.) contained in a check-in behavior, and 5d is the sum of the embedding sizes of all contexts of the check-in.
[0079] 2) The i-th trajectory in the user's long-term trajectory Input to the Transformer encoder as the initial input of layer 0, expressed as k represents the current trajectory The length of . Let the bidirectional Transformer encoder iterate l times, where the output of the encoder layer l can be expressed as In the iterative process, the output of the encoder layer l-1 will be used as the input of the layer l.
[0080] Among them, in the lth layer, the vector It will be input into a multi-head attention layer containing N attention heads. Specifically, the output of the first attention head in layer l is as follows:
[0081]
[0082] Where softmax(*) is a normalized exponential function; W Q , W K and is the learnable weight matrix associated with the query vector, key vector, and value vector in the first attention head of layer l in the Transformer encoder,
[0083] Then, the outputs of these N attention heads are stacked up using a linear layer to obtain the output Z of the multi-head attention layer. l -1′ , the specific calculation formula is as follows:
[0084]
[0085] in Represents a trainable weight matrix.
[0086] Then, in the original input Z l-1 And the output Z l-1′ Residual connections are made between them, and the final output of the multi-head attention layer is obtained through layer regularization and dropout regularization. The specific calculation is as follows:
[0087]
[0088] In the formula, LayerNorm(*) represents an L1 regularization function, and Dropout(*) represents a dropout regularization operation. Then, the final output of the multi-head attention layer is processed through the fully connected layer. To convert, the specific calculation is as follows:
[0089]
[0090] In the formula, ReLU(*) is an activation function; Respectively represent the learnable weight parameter matrix in the fully connected layer, They are The bias of the weight matrix. Finally, the final output of the multi-head attention layer And the output of the fully connected layer Residual connections are made between them, and the dropout regularization operation is used to obtain the final output Z of the lth layer l , the specific calculation is as follows:
[0091]
[0092] Where LayerNorm(*) represents an L2 regularization function, and Dropout(*) represents a dropout regularization operation.
[0093] Encoding all long-term trajectories Afterwards, the long-term preference is obtained through simple aggregation and average pooling operations Where Mean(*) represents the average pooling operation, and [·;·] represents the aggregation operation.
[0094] A Tran(*) function is used to represent the operations (1), (2), (3), (4), and (5) involved in the Transformer encoder.
[0095] 3) The user's short-term trajectory Input to the Transformer encoder as the initial input of layer 0, expressed as Let the bidirectional Transformer encoder iterate l times, where the output of the encoder layer l can be expressed as In the iterative process, the output of the encoder layer l-1 will be used as the input of the l layer. Finally, the output Z of the l layer l The vector obtained by average pooling is used as the user's short-term preference The specific calculation formula is as follows:
[0096]
[0097] Where Mean(*) represents the average pooling operation and Tran(*) represents the bidirectional Transformer encoder.
[0098] The user activity pattern extraction module obtains the user activity pattern c u The steps include:
[0099] 1) Use standard normal distribution to randomly generate user category trajectories The low-dimensional vector representation of Where n and m represent the lengths of long and short term trajectories respectively, d is the embedding size of the context information (such as category) contained in a category check-in, and 3d is the sum of all context embedding sizes of the category check-in.
[0100] 2) The i-th track in the user's category track Input to the LSTM encoder as the initial input of layer 0, expressed as i′ represents the length of the current category trajectory. Let the LSTM encoder iterate l times, where the output of the lth layer of the LSTM encoder can be expressed as Indicates that during the iteration, the output of the encoder layer l-1 will be used as the input of the layer l. Finally, the output Z of the layer l l As the output of this trajectory, the specific calculation is:
[0101]
[0102] Among them, LSTM (*) represents LSTM encoder. Afterwards, the category preference is obtained through simple aggregation and average pooling operations Where Mean(*) represents the average pooling operation, and [·;·] represents the aggregation operation.
[0103] 3) Set the time x for the next point of interest check-in t As the query vector, H c As the key vector and value vector, we use the temporal attention layer to obtain the user activity pattern c u , the specific calculation is as follows:
[0104]
[0105] Attention(Q,K,V)=sum((softmax(Q*K T ))*V) (9)
[0106] In the formula, Attention(*) represents an attention layer, sum(*) represents a summation operation, and softmax(*) represents an activation function.
[0107] The specific operation of the preference enhancement layer to enhance the characterization of long-term and short-term preferences by using user activity patterns is as follows: u As the query vector, e u,l As the key vector and value vector, the attention mechanism is used to obtain the long-term preference e after representation enhancement u,l , the specific calculation formula is as follows:
[0108]
[0109] Attention(Q,K,V)=sum((softmax(Q*K T ))*V) (11)
[0110] In the formula, Attention(*) represents an attention layer, sum(*) represents a summation operation, and softmax(*) represents an activation function. Similarly, cu As the query vector, e u,s As the key vector and value vector, the short-term preference after representation enhancement is obtained based on the attention mechanism.
[0111] The preference self-supervision decoupling module decouples users’ long-term and short-term preferences. u,l and e u,s The steps include:
[0112] 1) From the long-term trajectory of users and short-term trajectory Get the corresponding agent (preference label) from , the specific calculation formula is as follows:
[0113]
[0114]
[0115] In the formula, represents a check-in behavior in a long-term trajectory, Represents a check-in behavior in a short-term trajectory, and Mean(*) represents the average pooling operation.
[0116] 2) In the long-term and short-term preference representation u,l 、e u,s With preference proxy P u,l , P u,s By using contrastive learning, four contrastive tasks are designed. The contrastive tasks are as follows:
[0117] sin(e u,l ,P u,l )>sim(e u,l ,P u,s ) (14)
[0118] sim(P u,l ,e u,l )>sim(P u,l ,e u,s ) (15)
[0119] sim(e u,s ,P u,s )>sim(e u,s ,P u,l ) (16)
[0120] sim(P u,s ,e u,s )>sim(P u,s ,e u,l ) (17)
[0121] In the formula, sim(*) represents a similarity calculation function, which is used to calculate the similarity between vectors, so that formulas (14)-(15) can supervise long-term preferences, and formulas (16)-(17) can supervise short-term preferences, thereby realizing the decoupling of long-term and short-term preferences, and obtaining the decoupled long-term and short-term preferences e u,l 、e u,s .
[0122] The steps of the recommendation prediction module to predict the points of interest that the user may visit next include:
[0123] 1) Use the attention mechanism to integrate users’ long-term and short-term preferences u,l 、e u,s Get the user's final preference h u , the specific calculation is as follows:
[0124]
[0125] Attention(Q,K,V)=sum((softmax(Q*K T ))*V) (19)
[0126] In the formula, x u is the low-dimensional vector representation of the current user, “||” represents a concatenation operation, Attention(*) represents an attention layer, sum(*) represents a summation operation, and softmax(*) represents an activation function.
[0127] 2) Using the user's final preference h through the activation function u Predict the points of interest that the user may visit next. The specific calculation is as follows:
[0128]
[0129] In the formula, represents the probability distribution of the points of interest that the user may visit next, and |k| represents the number of points of interest in the dataset; represents a trainable parameter matrix; softmax(*) is an activation function.
[0130] Embodiment 2:
[0131] See also Figure 1 ,The usage process of the next point of interest recommendation method that decouples long-term and short-term preferences is as follows:
[0132] First, periodic long-term preferences and dynamic short-term preferences are captured from the user's masked long-term trajectory and short-term trajectory respectively. Subsequently, the user activity pattern is captured from the user's category trajectory. Then, the user activity pattern is used to enhance the preference representation of long-term and short-term preferences through the attention mechanism. Next, the long-term and short-term preference agents are captured from the long-term trajectory and short-term trajectory respectively. Furthermore, a contrastive learning paradigm is constructed, and four contrast tasks are designed between the long-term and short-term preference agents and the enhanced long-term and short-term preferences to achieve self-supervised decoupling of preferences. Finally, the user's long-term and short-term preferences are generated into the user's final preferences through an attention-based method, and the user's final preferences are used to obtain the predicted recommendation results through the activation function.
[0133] Specifically,
[0134] 1) Long-term and short-term preference modeling
[0135] Randomly mask the user's long-term trajectory to obtain the masked long-term trajectory Then, a standard normal distribution is used to randomly generate a low-dimensional vector representation of the long-term trajectory of the mask and short-term trajectory The low-dimensional vector representation of Where n and m represent the lengths of the long and short-term trajectories, respectively, i.e., n and m are the number of check-in behaviors contained in the long and short-term trajectories, respectively; d is the embedding size of the context information (such as POI category, time, POI, etc.) contained in a check-in behavior, and 5d is the sum of the embedding sizes of all contexts of the check-in;
[0136] 2) The i-th trajectory in the user's long-term trajectory Input to the Transformer encoder as the initial input of layer 0, expressed as k represents the current trajectory The length of . Let the bidirectional Transformer encoder iterate l times, where the output of the encoder layer l can be expressed as Indicates that during the iteration, the output of the encoder layer l-1 will be used as the input of the layer l;
[0137] Among them, in the lth layer, the vector It will be input into a multi-head attention layer containing N attention heads. Specifically, the output of the first attention head in layer l is as follows:
[0138]
[0139] Where softmax(*) is a normalized exponential function; W Q , W K and is the learnable weight matrix associated with the query vector, key vector, and value vector in the first attention head of layer l in the Transformer encoder,
[0140] Then, the outputs of these N attention heads are stacked up using a linear layer to obtain the output Z of the multi-head attention layer. l -1′ , the specific calculation formula is as follows:
[0141]
[0142] in Represents a trainable weight matrix.
[0143] Then, in the original input Z l-1 And the output Z l-1′ Residual connections are made between them, and the final output of the multi-head attention layer is obtained through layer regularization and dropout regularization. The specific calculation is as follows:
[0144]
[0145] In the formula, LayerNorm(*) represents an L1 regularization function, and Dropout(*) represents a dropout regularization operation. Then, the final output of the multi-head attention layer is processed through the fully connected layer. To convert, the specific calculation is as follows:
[0146]
[0147] In the formula, ReLU(*) is an activation function; Respectively represent the learnable weight parameter matrix in the fully connected layer, They are The bias of the weight matrix. Finally, the final output of the multi-head attention layer And the output of the fully connected layer Residual connections are made between them, and the dropout regularization operation is used to obtain the final output Z of the lth layer l , the specific calculation is as follows:
[0148]
[0149] In the formula, LayerNorm(*) represents an L2 regularization function, and Dropout(*) represents a dropout regularization operation. Afterwards, the long-term preference is obtained through aggregation and average pooling operations Where Mean(*) represents the average pooling operation, and [·;·] represents the aggregation operation.
[0150] A Tran(*) function is used to represent the operations (1), (2), (3), (4), and (5) involved in the Transformer encoder.
[0151] The user's short-term trajectory Input to the Transformer encoder as the initial input of layer 0, expressed as Let the bidirectional Transformer encoder iterate l times, where the output of the encoder layer l can be expressed as In the iterative process, the output of the encoder layer l-1 will be used as the input of the l layer. Finally, the output Z of the l layer l The vector obtained by average pooling is used as the short-term preference The specific calculation formula is as follows:
[0152]
[0153] Where Mean(*) represents the average pooling operation and Tran(*) represents the bidirectional Transformer encoder.
[0154] 2) Acquisition of user activity patterns
[0155] Use standard normal distribution to randomly generate user category trajectories The low-dimensional vector representation of Where n and m represent the lengths of long and short-term trajectories, respectively, d is the embedding size of the context information (such as category) contained in a category check-in, and 3d is the sum of all context embedding sizes of the category check-in;
[0156] The i-th track in the user's category track Input to the LSTM encoder as the initial input of layer 0, expressed as i′ represents the length of the current category trajectory. Let the LSTM encoder iterate l times, where the output of the encoder layer l can be expressed as Indicates that during the iteration, the output of the encoder layer l-1 will be used as the input of the layer l. Finally, the output Z of the layer l l As the output of this trajectory, the specific calculation is:
[0157]
[0158] Among them, LSTM (*) represents LSTM encoder. Afterwards, the category preference is obtained through simple aggregation and average pooling operations Where Mean(*) represents the average pooling operation, and [·;·] represents the aggregation operation.
[0159] 3) Enhanced representation of long-term and short-term preferences
[0160] Set user activity mode c u As the query vector, e u,l As the key vector and value vector, the attention mechanism is used to obtain the long-term preference e after representation enhancement u,l , the specific calculation formula is as follows:
[0161]
[0162] Attention(Q,K,V)=sum((softmax(Q*K T ))*V) (11)
[0163] In the formula, Attention(*) represents an attention layer, sum(*) represents a summation operation, and softmax(*) represents an activation function. Similarly, c u As the query vector, e u,s As the key vector and value vector, the short-term preference after representation enhancement is obtained based on the attention mechanism.
[0164] 4) Capturing long-term and short-term preference proxies
[0165] From the long-term trajectory of users and short-term trajectory The corresponding preference proxy (i.e. preference label) is obtained from , and the specific calculation formula is as follows:
[0166]
[0167]
[0168] In the formula, represents a check-in behavior in a long-term trajectory, Represents a check-in behavior in a short-term trajectory, and Mean(*) represents the average pooling operation.
[0169] 5) Self-supervision decoupling of long-term and short-term preferences
[0170] In the long-term and short-term preference representation u,l 、e u,s With preference proxy P u,l , P u,s By using contrastive learning, four contrastive tasks are designed. The contrastive tasks are as follows:
[0171] sim(eu,l ,P u,l )>sim(e u,l ,P u,s ) (14)
[0172] sim(P u,l ,e u,l )>sim(P u,l ,e u,s ) (15)
[0173] sim(e u,s ,P u,s )>sim(e u,s ,P u,l ) (16)
[0174] sim(P u,s ,e u,s )>sim(P u,s ,e u,l ) (17)
[0175] In the formula, sim(*) represents a similarity calculation function, which is used to calculate the similarity between vectors, so that formulas (14)-(15) can supervise long-term preferences, and formulas (16)-(17) can supervise short-term preferences, thereby realizing the decoupling of long-term and short-term preferences, and obtaining the decoupled long-term and short-term preferences e u,l 、e u,s .
[0176] 6) Recommendation prediction
[0177] Using attention mechanism to integrate users’ long-term and short-term preferences u,l 、e u,s Get the user's final preference h u , the specific calculation is as follows:
[0178]
[0179] Attention(Q,K,V)=sum((softmax(Q*K T ))*V) (19)
[0180] In the formula, x u is the low-dimensional vector representation of the current user, “||” represents a concatenation operation, Attention(*) represents an attention layer, sum(*) represents a summation operation, and Softmax(*) represents an activation function.
[0181] The user's final preference h is used through the activation function u Predict the points of interest that the user may visit next. The specific calculation is as follows:
[0182]
[0183] In the formula, represents the probability distribution of the points of interest that the user may visit next, and |k| represents the number of points of interest in the dataset; represents a trainable parameter matrix; softmax(*) is an activation function.
[0184] Embodiment 3:
[0185] The verification experiment of the next point of interest recommendation method that decouples long-term and short-term preferences is as follows:
[0186] Experimental setup
[0187] Datasets: Extensive experiments are conducted on three real-world datasets from Foursquare, namely Phoenix (PHO), New York (NYC), and Singapore (SIN). The main statistics of the datasets are shown in Table 1.
[0188] Table 1 Datasets used in the experiment
[0189]
[0190] For each data set, 80% of the user's historical access trajectories are randomly selected as the training set and 20% as the test set.
[0191] Baselines: To evaluate the effectiveness of our model, we compare the performance of DLSPAA with the following eight baseline methods:
[0192] ST-RNN: Incorporating temporal distance transfer matrices when modeling continuous check-in sequences using RNN to better utilize the spatiotemporal contextual information in POIs.
[0193] ATST-LSTM: Use the attention mechanism to assist LSTM in modeling the spatiotemporal information in the trajectory, and assign different weights to related historical check-ins to distinguish their importance.
[0194] PLSPL: It uses the attention layer to capture long-term preferences, uses LSTM to capture short-term preferences, and uses a personalized linear layer to distinguish the importance of the two preferences for the prediction results.
[0195] MCARNN: Taking spatial-activity topics as latent factors to predict the activities and locations that users are likely to visit next in a multi-task manner.
[0196] iMTL: Modeling sequential dependencies of activity and position using a dual-channel encoder in a multi-task format.
[0197] CTLE: A bidirectional transformer encoder is used to capture the left and right contextual information of the check-in records in the access trajectory to enrich the target representation, and the temporal information is used for representation enhancement when generating the position representation.
[0198] CFPRec: A state-of-the-art model based on long-term and short-term preference modeling, which extracts multi-step future preferences from long-term preferences in a self-assembly manner, and then fuses future preferences and short-term preferences based on attention for the final recommendation prediction.
[0199] CLSPRec: A state-of-the-art model based on long-term and short-term preference modeling. It takes the long-term and short-term preferences of the same user as positive sample pairs and the short-term preferences of other users as negative samples, and uses contrastive learning to enhance the representation of the same user's preferences and distinguish the preferences of different users.
[0200] Evaluation indicators
[0201] The model of the present invention adopts two widely used indicators in recommendation systems: HitRate@K (HR@K) and Normalized Discounted Cumulative Gain@K (NDCG@K), with K set to 5 and 10 to evaluate the performance of DLSPAA and eight baselines. Generally speaking, higher HR@K and NDCG@K metric values indicate better model performance.
[0202] Performance Comparison
[0203] Table 2 summarizes the comparison results. From this table, we can see that:
[0204] Overall, DLSPRec significantly outperforms all baseline models. Compared with the current state-of-the-art model CLSPRec, DLSPRec achieves average improvements of 10.84%, 8.17%, 15.51%, and 14.11% on HR@5, HR@10, NDCG@5, and NDCG@10 on the three datasets, respectively, and the improvement is most significant on the SIN dataset, which fully demonstrates the superiority of DLSPRec.
[0205] In addition, when using transformer as a preference extractor, the performance of models such as CTLE, CFPRec, and CLSPRec far exceeds that of models based on traditional sequence encoders. This reflects the powerful representation extraction capability of transformers and also indirectly reflects that the left and right contexts of sign-in can enrich the target representation.
[0206] Table 2 Performance comparison of all baselines
[0207]
[0208] Ablation experiment
[0209] In order to verify the effectiveness of each proposed component in the DLSPRec model of the present invention and its contribution to performance improvement, we set up four variant models for ablation experiments: DLSPRec / all: removing the mask, contrastive learning and user activity pattern modules at the same time; DLSPRec / D: removing the contrastive learning module; DLSPRec / A: removing the user activity pattern module; DLSPRec / M: removing the mask module. The experimental results of different variants of DLSPRec on the PHO and NYC datasets are shown in Figure 2. Figure 2 As shown, we can draw the following conclusions:
[0210] 1) Overall, removing the mask, contrastive learning, and user activity pattern modules will significantly damage the performance of the model, which shows that the three proposed modules are effective and necessary for the DLSPRec model.
[0211] 2) Comparing the three variants of DLSPRec / D, DLSPRec / A, and DLSPRec / M, the overall performance of DLSPRec / D has dropped the most. This indirectly reflects that the contrastive learning module can effectively improve the performance of the model, that is, the self-supervised decoupling of long-term and short-term preferences is meaningful and effective, and a more accurate representation of long-term and short-term preferences can be obtained through the decoupling operation.
[0212] 3) The decrease in HR@5 index of DLSPRec / M and DLSPRec / A variants is significantly greater than that of NDCG@5 index, indicating that the mask module and user activity pattern module are not only beneficial to the recommendation order, but also more conducive to improving the recommendation hit rate.
[0213] Decoupling visualization
[0214] Considering that one of the goals of the present invention is to disentangle the possible entangled long-term and short-term preferences to improve the recommendation performance, the long-term and short-term preferences learned from the test sets in the NYC and SIN datasets are visualized. Specifically, the t-SNE algorithm is used to map the learned multidimensional preference representation to a two-dimensional space. Figure 3 (a) and Figure 3 (c) is the visualization result without preference decoupling. Figure 3 (b) and Figure 3 (d) is the visualization result of self-supervised decoupling of long-term and short-term preference representations achieved through contrastive learning. It can be seen Figure 3 (b) and Figure 3 (d) The ratio of long-term to short-term preference Figure 3 (a) and Figure 3(c) is more orderly and clearly distinguished, indicating that DLSPRec successfully separates long-term and short-term preferences. It is worth noting that since the long-term and short-term preferences of users can be the same or similar in the next POI recommendation, it is not possible to obtain a visualization result that is completely independent of the long-term and short-term preferences.
Claims
1. A next point of interest recommendation method that decouples long-term and short-term preferences, characterized by: It includes long-term and short-term preference extraction module, user activity pattern extraction module, preference enhancement module, preference self-supervision decoupling module and recommendation prediction module. The long-term and short-term preference extraction module first extracts the user's long-term trajectory Perform masking to obtain masked long-term trajectory Then randomly generate mask long-term trajectories Long-term trajectory and short-term trajectory The low-dimensional vector representation of Then, two independent bidirectional Transformer encoders are used to and Capturing users’ periodic long-term preferences u,l and user dynamic short-term preferences u,s ,The two preferences are then passed to the preference enhancement module. The user activity pattern extraction module first randomly generates the user's category trajectory Q u The low-dimensional vector representation of Then it is passed to the LSTM encoder to obtain the category preference H c . Then the next point of interest check-in time x t As the query vector, H c As key vectors and value vectors, the temporal attention layer is used to extract the user activity pattern c u , and transmit it to the preference enhancement module. The preference enhancement module converts the user activity pattern c u As the query vector, e u,l As the key vector and value vector, the input attention layer obtains the enhanced long-term preference e u,l ; Similarly, the user activity mode c u As the query vector, e u,s As the key vector and value vector, the short-term preference e after the representation enhancement is passed into the attention layer u,s . Then the long-term and short-term preferences e u,l 、e u,s Transferred to the preference self-supervised decoupling module. The preference self-supervision decoupling module is respectively Obtain the preference proxy p corresponding to the long-term preference u,l ,from Get the preference proxy p corresponding to the short-term preference u,s Then, p u,l and p u,s As a self-supervisory signal, in e u,l 、e u,s Corresponding to p u,l 、p u,s By using contrastive learning and designing four contrast tasks, the long-term and short-term preferences are self-supervised and decoupled. u,l 、e u,s Transmitted to the recommendation prediction module. The recommendation prediction module first integrates the user's decoupled long-term and short-term preferences based on attention. u,l 、e u,s Get the user's final preference h u , and then use the user's final preference h through the activation function u Predict the points of interest that the user may visit next and send the predicted points of interest to the user.
2. The next point of interest recommendation method for decoupling long-term and short-term preferences according to claim 1, characterized in that: In the long-term and short-term preference extraction module, obtain e u,l and e u,s The steps include: 1) The traces are randomly masked to obtain Then, a standard normal distribution is used to randomly generate a low-dimensional vector representation of the long-term trajectory of the mask and short-term trajectory The low-dimensional vector representation of Where n and m represent the length of the user's long-term and short-term trajectories, that is, n and m are the number of check-in behaviors contained in the long-term and short-term trajectories; d is the embedding size of the context information contained in a check-in behavior, and 5d is the sum of the embedding sizes of all contexts of the check-in. represents the set of real numbers; 2) The i-th trajectory in the user's long-term trajectory Input to the Transformer encoder as the initial input of layer 0, expressed as k represents The length of . Let the bidirectional Transformer encoder iterate l times, where the output of the encoder layer l is Indicates that during the iteration, the output of the encoder layer l-1 will be used as the input of the layer l; Among them, in the lth layer, will be input into a multi-head attention layer containing N attention heads; specifically, the output of the first attention head in layer l is as follows: Where softmax(*) is a normalized exponential function; W Q , W K and is the learnable weight matrix associated with the query vector, key vector, and value vector in the first attention head of layer l in the Transformer encoder, Then, the outputs of these N attention heads are stacked up using a linear layer to obtain the output Z of the multi-head attention layer. l-1′ , the specific calculation formula is as follows: in Represents a trainable weight matrix. Then, in the original input Z l-1 And the output Z l-1′ Residual connections are made between them, and the final output of the multi-head attention layer is obtained through layer regularization and dropout regularization. The specific calculation is as follows: In the formula, LayerNorm(*) represents an L1 regularization function, and Dropout(*) represents a dropout regularization operation. Then, the final output of the multi-head attention layer is processed through the fully connected layer. To convert, the specific calculation is as follows: In the formula, ReLU(*) is an activation function; Respectively represent the learnable weight parameter matrix in the fully connected layer, They are The bias of the weight matrix. Finally, the final output of the multi-head attention layer And the output of the fully connected layer Residual connections are made between them, and the dropout regularization operation is used to obtain the final output Z of the lth layer l , the specific calculation is as follows: Where LayerNorm(*) represents an L2 regularization function, and Dropout(*) represents a dropout regularization operation. Encoding all long-term trajectories of users Afterwards, the long-term preference is obtained through aggregation and average pooling operations Where Mean(*) represents the average pooling operation, and [·;·] represents the aggregation operation. A Tran(*) function is used to represent the operations (1), (2), (3), (4), and (5) involved in the Transformer encoder. 3) The user's short-term trajectory Input to the Transformer encoder as the initial input of layer 0, expressed as Let the bidirectional Transformer encoder iterate l times, where the output of the encoder layer l can be expressed as In the iterative process, the output of the encoder layer l-1 will be used as the input of the l layer. Finally, the output Z of the l layer l The vector obtained by average pooling is used as the short-term preference The specific calculation formula is as follows: Where Mean(*) represents the average pooling operation and Tran(*) represents the bidirectional Transformer encoder.
3. The next point of interest recommendation method for decoupling long-term and short-term preferences according to claim 1, characterized in that: In the user activity pattern extraction module, the user activity pattern c is obtained. u The steps include: 1) Use standard normal distribution to randomly generate user category trajectories The low-dimensional vector representation of Where n and m represent the lengths of the user's long and short-term trajectories, respectively, d is the embedding size of the context information contained in a category check-in, and 3d is the sum of all context embedding sizes of the category check-in; 2) Represent the low-dimensional vector of the i-th category trajectory in the user's category trajectory Input to the LSTM encoder as the initial input of layer 0, expressed as i′ represents the length of the current category trajectory, and the LSTM encoder is allowed to iterate l times, where the output of the lth layer of the LSTM encoder is Indicates that during the iteration, the output of the encoder layer l-1 will be used as the input of the layer l. Finally, the output Z of the layer l l As the output of this trajectory, the specific calculation is: Among them, LSTM(*) represents LSTM encoder. Afterwards, the category preference is obtained through simple aggregation and average pooling operations Where Mean(*) represents the average pooling operation, and [·;·] represents the aggregation operation. 3) Set the time x for the next point of interest check-in t As the query vector, H c As the key vector and value vector, we use the temporal attention layer to obtain the user activity pattern c u , the specific calculation is as follows: Attention(Q,K,V)=sum((softmax(Q*K T ))*V) (9) In the formula, Attention(*) represents an attention layer, sum(*) represents a summation operation, and softmax(*) represents an activation function.
4. The next point of interest recommendation method for decoupling long-term and short-term preferences according to claim 1, characterized in that: Will get e u,l and e u,s The specific calculation formula is as follows: Attention(Q,K,V)=sum((softmax(Q*K T ))*V) (11) In the formula, Attention(*) represents an attention layer, sum(*) represents a summation operation, and softmax(*) represents an activation function. and calculate e u,l Similar to the method, c u As the query vector, e u,s As the key vector and value vector, the short-term preference after representation enhancement is obtained based on the attention mechanism.
5. The next point of interest recommendation method for decoupling long-term and short-term preferences according to claim 1, characterized in that: The preference self-supervised decoupling module decouples e u,l and e u,s The steps include: 1) From and The corresponding preference proxy is obtained from , and the specific calculation formula is as follows: In the formula, represents a check-in behavior in a long-term trajectory, represents a check-in behavior in a short-term trajectory, and Mean(*) represents the average pooling operation. 2) In e u,l 、e u,s The corresponding P u,l , P u,s By using contrastive learning, four contrastive tasks are designed. The contrastive tasks are as follows: yes(and u,l ,P u,l )>yes(and u,l ,P u,s ) (14) yes(P u,l ,and u,l )>yes(P u,l ,and u,s ) (15) yes(and u,s ,P u,s )>yes(and u,s ,P u,l ) (16) yes(P u,s ,and u,s )>yes(P u,s ,and u,l ) (17) In the formula, sim(*) represents a similarity calculation function, which is used to calculate the similarity between vectors, so that formulas (14)-(15) can supervise long-term preferences, and formulas (16)-(17) can supervise short-term preferences, thereby realizing the decoupling of long-term and short-term preferences, and obtaining the decoupled long-term and short-term preferences e u,l 、e u,s .
6. The next point of interest recommendation method for decoupling long-term and short-term preferences according to claim 1, characterized in that: In the recommendation prediction module, the step of predicting the points of interest that the user may visit next includes: 1) Using attention mechanism to fuse e u,l 、e u,s Get the user's final preference h u , the specific calculation is as follows: Attention(Q,K,V)=sum((softmax(Q*K T ))*V) (19) Among them, x u is the low-dimensional vector representation of the current user, "||" represents a concatenation operation, Attention(*) represents an attention layer, sum(*) represents a summation operation, and softmax(*) represents an activation function. 2) Using the user's final preference h through the activation function u Predict the points of interest that the user may visit next. The specific calculation is as follows: In the formula, represents the probability distribution of the points of interest that the user may visit next, and |k| represents the number of points of interest in the dataset; represents a trainable parameter matrix; softmax(*) is an activation function.
Citation Information
Cited By
Interest point recommendation method for low-quality data scene
CN119622122A
Self-supervised trajectory learning tourist route recommendation method based on spatial relationship enhancement
CN121233862A
