Location recommendation method based on shared hypergraph mask
Through the shared hypergraph mask strategy and the two-level contrastive learning module, the sparsity and incompleteness problems of user trajectory data in existing methods are solved, more efficient POI recommendation is achieved, and the recommendation accuracy and model robustness are improved.
Patent Information
- Application Number
- CN202510782175.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-12
- Publication Date
- 2025-09-12
AI Technical Summary
Existing POI recommendation methods have difficulty in effectively capturing high-level collaboration among users and the consistency of long-term and short-term behaviors when dealing with sparse and incomplete user trajectory data, resulting in insufficient recommendation accuracy.
A shared hypergraph mask strategy is adopted to construct long- and short-term trajectory hypergraphs, combined with autoencoders and two-level contrastive learning modules to improve the robustness and accuracy of the model to user behavior patterns.
It significantly improves the accuracy of point of interest recommendations and the robustness of the model, can better capture the high-order collaboration between users and the consistency of long-term and short-term behaviors, and improves the recommendation performance.
Smart Images

Figure CN120633864A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of natural language processing, and in particular to a location recommendation method based on shared hypergraph masks. Background Art
[0002] Next-Point-of-Interest (Next-POI) recommendation aims to provide suggestions for locations that users may be interested in next. It is a sequential recommendation system based on historical data. It plays an important role in various fields, such as user exploration, merchant decision-making, and urban planning, and has attracted increasing research attention in recent years. However, due to the sparseness of location data and the dynamic nature of user behavior, the recommendation process is more susceptible to bias. In recommendation systems, the completeness and quality of user behavior data have a critical impact on recommendation performance. Unlike e-commerce platforms that can fully record user clicks, browsing, and purchases, user trajectory data in location-based recommendations is often highly discrete and of low quality. This is due to increased privacy awareness and the lack of check-ins. This discreteness and discontinuity severely limit the performance of recommendation models.
[0003] As a key branch of the sequential recommendation task, next point of interest (POI) recommendation aims to predict locations of potential interest to users based on their historical check-in data. Early POI recommendation methods primarily relied on POI visit frequency and simple statistical methods. However, these methods tended to recommend fixed, high-frequency locations and struggled to adapt to users' dynamic and personalized needs. Subsequent research employed traditional methods such as matrix factorization (MF) and Markov chains (MC), but these methods encountered performance bottlenecks when processing complex trajectory sequences. With the rise of deep learning (DL), its powerful feature extraction capabilities have garnered widespread attention. Early DL-based research employed recurrent neural networks (RNNs) to better capture sequential context. Subsequently, attention-based models demonstrated their advantages in extracting key information from trajectories. For example, SASRec leverages self-attention to dynamically weight items in interaction sequences, and SSE-PT models personalized user features through random embedding replacement. However, the core challenge of next POI recommendation lies not only in modeling sequential patterns but also in addressing spatiotemporal dynamics. Improved models such as TiSASRec incorporate temporal information into the SASRec framework, and STAN effectively captures spatiotemporal trajectory features through relative time and distance modeling. While these sequential methods focus on modeling individual user behavior, they often overlook collaborative information between users. Inspired by the ability of graph neural networks (GNNs) to model high-order neighborhood similarities and complex relationships, recent research, such as GETNext, leverages collaborative signals by combining a global user trajectory graph with a graph-augmented Transformer. DisenPOI employs graph-based disentangled contrastive learning to separate trajectory and geographic influence. CrossDR improves spatiotemporal preference modeling through disentangled representations. While these advances are promising, most overlook the inherent incompleteness of trajectory data, resulting in suboptimal user behavior pattern extraction. To extract robust user behavior patterns from discrete, incomplete trajectory data, recent research has introduced contrastive learning (CL) to sequential recommendation, improving training performance by generating signals in a self-supervised manner. CLS4Rec proposes a contrastive framework that enhances user sequence views through cropping, masking, and reordering to alleviate data sparsity in sequential recommendation. HCCF combines hypergraph structure learning with cross-view contrast to capture high-order collaborative relationships using a global hypergraph. Furthermore, to reduce trajectory sparsity, some researchers segment long trajectories into shorter, continuous segments to extract more dense short-term behavior patterns. MSTHN utilizes graph structures to model continuous short trajectories, greatly improving the recommendation performance; MobGT uses spatiotemporal attention graph neural networks to process continuous short trajectories to capture unique fine-grained features specific to continuous information fragments.
[0004] Existing CL-based methods typically rely on heuristic artificial data perturbations to generate contrasting views, requiring high-quality enhancements and precise view construction. This design requires expert knowledge and manual intervention, limiting its application in diverse low-supervision scenarios. In addition, random modifications to sequence structures may destroy important transition patterns and impair representation learning. At the same time, although modeling continuous short-term trajectories can improve recommendation performance, we believe that there is potential high-order consistency between long-term and short-term behaviors, and joint modeling may improve recommendation accuracy. However, most existing methods use sequence or graph models alone, ignoring high-order collaboration between users, and using independent encoders to process data at different time periods, treating them as independent of each other, ignoring internal consistency and pattern similarity. Summary of the Invention
[0005] In view of the above problems existing in the prior art, the technical problem to be solved by the present invention is: how to improve the accuracy of POI recommendation by using a shared hypergraph mask strategy.
[0006] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0007] A location recommendation method based on shared hypergraph mask includes the following steps:
[0008] S100: Select a public user trajectory dataset S, where each user trajectory is a sample and each sample includes a user set U, a user point of interest check-in location set V, and a user visit point of interest location timestamp set T, as shown in the following expression:
[0009]
[0010] U={u1,u2,…,u |U|}
[0011] V={v1,v2,…,v |V|}
[0012] T={t1,t2,…,t |T|}
[0013] Among them, |U| represents the total number of users, |V| represents the total number of POI locations, and |T| represents the total number of timestamps;
[0014] S200: Construct a hypergraph mask POI recommendation model (SHGMAE). SHGMAE includes a hypergraph mask autoencoder module, a two-level contrastive learning module, and a Transformer encoder. The hypergraph mask autoencoder module includes a long-trajectory hypergraph autoencoder and a shared hypergraph autoencoder. The two-level contrastive learning module includes a contrastive decoupling learning layer, a contrastive enhancement learning layer, and an embedding fusion layer.
[0015] S300: Obtain the user's long trajectory S based on S u and user short trajectory S u′ , through S u Constructing a long trajectory hypergraph By S u′ Constructing a short trajectory hypergraph
[0016] S400: As the input of the long trajectory hypergraph autoencoder, the output is the long trajectory mask hypergraph Then After decoding and reconstruction by the multi-layer perceptron MLP, the long trajectory hypergraph autoencoder objective function is obtained
[0017] Will and As the input of the shared hypergraph autoencoder, the outputs are The corresponding short trajectory interest point representation Z S,V and short trajectory user representation Z S,U ,as well as The corresponding long trajectory interest point representation Z L,V and long trajectory user representation Z L,U ;
[0018] S500: Z L,V ,Z L,U and Z S,V ,Z S,U Enter the two-level contrastive learning module:
[0019] Z L,V and Z S,V After embedding the fusion layer, the interest point fusion representation Z is obtained F,V , Z L,U and Z S,U After embedding the fusion layer, the user fusion representation Z is obtained F,U , the calculation expression is as follows:
[0020] Z F,V =Z L,V W1+Z S,V (1-W1)
[0021] Z F,U =Z L,U W2+Z S,U (1-W2)
[0022] in, and Both represent learnable aggregation matrices;
[0023] Z L,V ,Z L,Uand Z S,V ,Z S,U After comparing the decoupled learning layers, the global loss function is constructed using the InfoNCE objective function.
[0024] Z L,V and S u The long trajectory enhanced view representation is calculated by the contrast enhancement learning layer Z S,V and S u′ The short trajectory enhanced view representation is calculated by the contrast enhancement learning layer Then use and At the same time, the NT-Xent objective function is used to construct the local loss function
[0025] S600: Looking for the S u In Z F,V , Z F,U The location information corresponding to each point of interest in the local trajectory is obtained by combining these location information. u , E u Get the prediction result through Transformer encoder Then use and points of interest v l In z F,V The corresponding representation zF ,vl Constructing a recommendation loss function
[0026] S700: Exploitation and Constructing the SHGMAE overall loss function Take S as data input, use Adam as training optimizer, and use Update SHGMAE parameters in reverse order. When the training reaches the maximum number of iterations or When it no longer changes, the training is stopped. At this time, the trained hypergraph mask POI recommendation model SHGMAE' is obtained, and its calculation expression is as follows:
[0027]
[0028] Among them, λ1 and λ2 are weight coefficients of the loss function, which are used to control the weight ratio of decoding reconstruction loss and contrastive learning loss respectively;
[0029] S800: Input the historical trajectory Y of the user to be predicted into SHGMAE', and output the prediction result Y' of the next point of interest of the user.
[0030] As an example, the long trajectory hypergraph is constructed in S300 and short trajectory hypergraph The content is as follows:
[0031] Define the user's check-in location at a point of interest as a hypergraph node v, and define the trajectory formed by all the user's check-in locations at points of interest as a hypergraph hyperedge e; and The expression is: in, represents the set of nodes of the short-trajectory hypergraph, Represents the node set of the long trajectory hypergraph, ε S represents the set of hyperedges in the short trajectory hypergraph and ε L Represents the set of hyperedges in a long trajectory hypergraph;
[0032] For each v∈e on the long trajectory, the node degree corresponding to v is defined as Among them, W e Represents the specified positive weights, all positive weights form a diagonal matrix Use d(v) to form the diagonal node degree matrix D Lv ; For each e∈ε of the long trajectory L , the hyperedge degree corresponding to e is Use d(e) to form the diagonal hyperedge degree matrix D Le ;D Lv and D Le Combine to get a long trajectory hypergraph in, Similarly, we get the short trajectory hypergraph
[0033] As an advantage, the objective function of the long trajectory hypergraph autoencoder obtained in S400 is The steps are as follows:
[0034] S410: Embed Middle and back, right Embed The semantic consistency calculation of the result is as follows:
[0035]
[0036] Where γ(v) represents The semantic relevance score between the corresponding k-order transfer sub-hypergraph, represents the set of k-hop neighbors of v, v″ and represents the neighbor node of v, z L,v represents the embedding representation of v, z L,v″ represents the embedding representation of v″;
[0037] S411: Set a semantic relevance score threshold, and obtain the key anchor node set from the node set corresponding to all γ(v)s with scores higher than the semantic relevance score threshold
[0038] S412: Calculate interaction mask ε L,m , the calculation expression is as follows:
[0039] ε L,m ~RandomWalk(V α ,l walk )
[0040] Among them, RandomWalk is a random walk strategy, l walk represents the length of the random walk;
[0041] Using ε L,m Obtaining long trajectory mask hypergraph The calculation expression is as follows:
[0042]
[0043] Among them, ε L,m Represents the set of hyperedges in the long trajectory mask hypergraph;
[0044] S413: Using MLP Perform decoding and reconstruction to obtain the long trajectory hypergraph autoencoder objective function The calculation expression is as follows:
[0045]
[0046] in, represents the positive sample loss, represents the negative sample loss, H L + represents the set of interactive positive samples, H L - Represents the set of negative samples of interaction, |h + | indicates that H L + The number of positive samples sampled in |h - | indicates that H L - The number of negative samples sampled, u + represents the positive sample user, v + Represents the positive sample interest point node, u - represents negative sample users, v - Represents the negative sample interest point node.
[0047] As an example, in the step S400, the short trajectory interest point representation Z is output. S,V, short trajectory user representation Z S,U , long trajectory interest point representation Z L,V and long trajectory user representation Z L,U The steps are as follows:
[0048] First calculate The calculation expression is as follows:
[0049]
[0050] in, Represents the l-th layer long trajectory mask hypergraph The set of interest point embeddings, W is the shared hypergraph neural network parameter matrix, represents the incidence matrix of the hypergraph after long trajectory masking, represents the diagonal node degree matrix of the hypergraph after long trajectory masking, represents the diagonal hyperedge degree matrix of the hypergraph after long trajectory masking, |Γ| represents the number of layers of the shared hypergraph neural network, and d represents the dimension of representation;
[0051] use Calculate Z L,V and Z L,U The calculation expression is as follows:
[0052]
[0053] where Γ represents the Γth layer of the long trajectory mask hypergraph, and |Γ| represents the total number of layers;
[0054] Similarly, calculation The calculation expression is as follows:
[0055]
[0056] in, Represents the short trajectory hypergraph of the lth layer The interest point embedding set, D Sv Denotes the diagonal node degree matrix of the short trajectory hypergraph, H S Represents the incidence matrix of the short trajectory hypergraph, D Se Represents the diagonal hyperedge degree matrix of the short trajectory hypergraph;
[0057] use Calculate Z S,V and Z S,U The calculation expression is as follows:
[0058]
[0059] where Γ′ denotes the Γ′th layer of the short trajectory mask hypergraph and |Γ′| denotes the total number of layers.
[0060] As an advantage, in S500, the global loss function is obtained. and local loss function The content is as follows:
[0061] Using Z S,V , Z S,U , Z L,V and Z L,U Constructing the overall loss function The calculation expression is as follows:
[0062]
[0063] Where s(·,·) is the cosine similarity function, u′≠u and u′∈U, v′≠v and v′∈V, τ is the temperature parameter;
[0064] use Calculate the local loss function The calculation expression is as follows:
[0065]
[0066] in, Denotes user u embedded using long trajectory interest point representation i The trajectory of Denotes user u embedded using short trajectory interest point representation i The trajectory representation of represents the trajectory representation of user u′ embedded using the long trajectory interest point representation, represents the trajectory representation of user u′ embedded using the short trajectory interest point representation, and B represents the training sample set during the training process.
[0067] As an example, in S600, the recommendation loss function is obtained. The content is as follows:
[0068]
[0069] Among them, σ represents the Sigmoid function, represents the sequence representation of user u, Indicates the next real access point v n+1 The embedding representation of represents negative samples randomly sampled from POIs that user u has not visited;
[0070] Assume that the historical trajectory of user u is S′ u ={v1, v2..., v l}, E u Calculated by Transformer Among them, E u The calculation expression is as follows:
[0071]
[0072] Where l represents S′ u The length of p l Indicates the point of interest v l The corresponding position code.
[0073] Compared with the prior art, the present invention has at least the following advantages:
[0074] 1. We explore the potential of graph masking strategies in hypergraph structures and propose an adaptive long-trajectory hypergraph masked autoencoder. This method generates a robust self-supervisory signal through a mask reconstruction task, avoiding the additional noise introduced by existing contrastive learning-based methods due to random structural perturbations. It also improves the ability to extract stable, high-quality long-term behavioral pattern representations from discrete trajectory data.
[0075] 2. A collaborative modeling method for long- and short-term trajectories based on a shared hypergraph neural network is proposed. This method addresses the problem that most existing methods use sequence or graph models alone, ignoring high-order collaboration between users, and use independent encoders to process data from different time periods, treating them as independent of each other and ignoring internal consistency and pattern similarity. It deeply explores the high-order internal consistency and similarity between user behavior patterns, significantly enhancing the ability to capture cross-user collaborative patterns.
[0076] 3. Design a two-level contrastive learning decoupling strategy to alleviate the potential feature entanglement and over-smoothing problems in the shared architecture, while enhancing the common characteristics of individual users' long-term and short-term behaviors and clarifying the behavioral differences between users.
[0077] 4. Comprehensive experiments on three real-world location datasets show that the proposed method significantly outperforms existing methods in terms of recommendation performance and model robustness. BRIEF DESCRIPTION OF THE DRAWINGS
[0078] Figure 1 Schematic diagram of the SHGMAE model architecture of the present invention.
[0079] Figure 2 The hyperparameter study of HR@10 and NDCG@10 of SHGMAE on NYC, TKY and CA in the experiment of this invention: (a), (b), (c) represent the performance changes of the masked autoencoder loss weight λ1 on the datasets NYC, TKY and CA respectively; (d), (e), (f) represent the performance changes of the contrastive learning loss weight λ2 on the datasets NYC, TKY and CA respectively; (g), (h), (i) represent the anchor node sets The performance changes of the number of masks on the datasets NYC, TKY and CA; (j), (k), and (l) represent the performance changes of the mask depth K on the datasets NYC, TKY and CA, respectively.
[0080] Figure 3 The different sparsities of NDCG@5 and HR@5 in NYC, TKY, and CA in the experiment of the present invention: (a), (c), and (e) represent the changes of NDCG@5 of different models under different sparsities of NYC, TKY, and CA, respectively; (b), (d), and (f) represent the changes of HR@5 of different models under different sparsities of NYC, TKY, and CA, respectively.
[0081] Figure 4 Figure 3 is a visualization of the long-term and short-term user behavior representations in different model variants of NYC in the experiment of the present invention: (a) represents the visualization of the long-term and short-term behavior representations using a shared hypergraph and contrastive learning; (b) represents the visualization of the long-term and short-term behavior representations using a shared hypergraph but not contrastive learning; (c) represents the visualization of the long-term and short-term behavior representations using contrastive learning without a shared hypergraph; (d) represents the visualization of the long-term and short-term behavior representations using neither a shared hypergraph nor contrastive learning. DETAILED DESCRIPTION
[0082] The present invention is described in further detail below.
[0083] Because the self-supervisory signal of a graph masked autoencoder is inherently derived from the internal structure of the graph, this naturally avoids the additional noise introduced by artificial view augmentation in existing CL-based methods and effectively enhances the modeling capability of deep topological information in the graph. Therefore, to more effectively extract high-quality, high-order collaborative user signals from highly discrete long-term trajectory hypergraphs, this method proposes an adaptive long-trajectory hypergraph masking strategy. This method selectively masks the more valuable cross-hyperedge interactions in the long-trajectory hypergraph and inputs the masked hypergraph structure into the autoencoder for reconstruction. This strategy forces the model to seek alternative signals from other structural information during training to adapt to the masked structure, thereby better leveraging the structural dependencies of the hypergraph, capturing high-order neighborhood patterns, and generating more robust self-supervised collaborative signals. Furthermore, this method proposes a collaborative modeling method based on a shared hypergraph neural network, aiming to deeply explore the high-order intrinsic consistency and similarity of the long-term and short-term behaviors of different users and fully leveraging the robust hypergraph masked autoencoder trained using the long-trajectory masking strategy. By sharing the same hypergraph neural network when modeling long-term and short-term behaviors, the model effectively captures high-order collaborative consistency signals between trajectories, thereby improving recommendation accuracy and generalization. At the same time, the present invention proposes a two-level contrastive learning strategy: in order to address potential risks in shared hypergraphs (such as feature entanglement and over-smoothing problems between the long-term and short-term behavior representations of different users), global hypergraph contrastive decoupling learning is proposed; in addition, in order to deeply explore the intrinsic consistency of individual users' long-term and short-term behavior patterns, local trajectory contrastive reinforcement learning is designed.
[0084] See also Figure 1-Figure 4 ,A place recommendation method based on shared hypergraph mask, comprising the following steps:
[0085] S100: Select a public user trajectory dataset S, where each user trajectory is a sample and each sample includes a user set U, a user point of interest check-in location set V, and a user visit point of interest location timestamp set T, as shown in the following expression:
[0086]
[0087] U={u1,u2,…,u |U|}
[0088] V={v1,v2,…,v |V|}
[0089] T={t1,t2,…,t |T|}
[0090] Among them, |U| represents the total number of users, |V| represents the total number of POI locations, and |T| represents the total number of timestamps.
[0091] S200: Construct a hypergraph mask POI recommendation model SHGMAE, which includes a hypergraph mask autoencoder module, a two-level contrastive learning module and a Transformer encoder. The hypergraph mask autoencoder module includes a long-trajectory hypergraph autoencoder and a shared hypergraph autoencoder; the two-level contrastive learning module includes a contrastive decoupling learning layer, a contrastive enhancement learning layer and an embedding fusion layer; the hypergraph autoencoder is a neural network and the Transformer encoder are both existing technologies; contrastive decoupling learning and contrastive enhancement learning are both existing technologies.
[0092] S300: Obtain the user's long trajectory S based on S u and user short trajectory S u′ , through S u Constructing a long trajectory hypergraph By S u′ Constructing a short trajectory hypergraph
[0093] The long trajectory hypergraph is constructed in S300 and short-trajectory hypergraphs The content is as follows:
[0094] Define the user's check-in location at a point of interest as a hypergraph node v, and define the trajectory formed by all the user's check-in locations at points of interest as a hypergraph hyperedge e; and The expression is: in, represents the set of nodes of the short-trajectory hypergraph, Represents the node set of the long trajectory hypergraph, ε S represents the set of hyperedges in the short trajectory hypergraph and ε L Represents the set of hyperedges in a long trajectory hypergraph;
[0095] For each v∈e on the long trajectory, the node degree corresponding to v is defined as Among them, W e Represents the specified positive weights, all positive weights form a diagonal matrix Use d(v) to form the diagonal node degree matrix D Lv ; For each e∈ε of the long trajectory L , the corresponding hyperedge degree of e is Use d(e) to form the diagonal hyperedge degree matrix D Le ;D Lv and D Le Combine to get a long trajectory hypergraph in, Similarly, we get the short trajectory hypergraph
[0096] This method aggregates users' personalized location preferences on hyperedges and models the collaborative signals of user group trajectories through a hypergraph structure.
[0097] S400: As the input of the long trajectory hypergraph autoencoder, the output is the long trajectory mask hypergraph Then After decoding and reconstruction by the multi-layer perceptron MLP, the long trajectory hypergraph autoencoder objective function is obtained Multilayer Perceptron MLP is an existing technology;
[0098] Will and As the input of the shared hypergraph autoencoder, the outputs are The corresponding short trajectory interest point representation Z S,V and short trajectory user representation Z S,U ,as well as The corresponding long trajectory interest point representation Z L,V and long trajectory user representation Z L,U ;
[0099] The objective function of the long trajectory hypergraph autoencoder is obtained in S400 The steps are as follows:
[0100] S410: Embed Middle and back, right Embed The semantic consistency calculation of the result is as follows:
[0101]
[0102] Where γ(v) represents The semantic relevance score between the corresponding k-order transfer sub-hypergraph, represents the set of k-hop neighbors of v, v″ and represents the neighbor node of v, z L,v represents the embedding representation of v, z L,v″ represents the embedding representation of v″;
[0103] S411: Set a semantic relevance score threshold, and obtain the key anchor node set from the node set corresponding to all γ(v)s with scores higher than the semantic relevance score threshold Nodes with higher semantic relevance scores exhibit stronger structural consistency within their neighborhood, indicating that the cross-hyperedge masks generated based on such nodes can effectively capture the potential cross-trajectory transfer patterns while containing less noise, which gives them a significant advantage in self-supervised learning reconstruction tasks.
[0104] S412: Calculate interaction mask ε L,m , the calculation expression is as follows:
[0105] ε L,m ~RandomWalk(V α ,l walk )
[0106] Among them, RandomWalk is a random walk strategy, l walk represents the length of the random walk;
[0107] Using ε L,m, Obtaining long trajectory mask hypergraph The calculation expression is as follows:
[0108]
[0109] Among them, ε L,m Represents the set of hyperedges in the long trajectory mask hypergraph;
[0110] S413: Using MLP Perform decoding and reconstruction to obtain the long trajectory hypergraph autoencoder objective function The calculation expression is as follows:
[0111]
[0112] in, represents the positive sample loss, represents the negative sample loss, H L + Represents the set of interactive positive samples, H L - Represents the set of negative samples of interaction, |h + | indicates that H L + The number of positive samples sampled in |h - | indicates that H L - The number of negative samples sampled, u + represents the positive sample user, v + Represents the positive sample interest point node, u - represents negative sample users, v - Represents the negative sample interest point node;
[0113] In the step S400, the short trajectory interest point representation Z is output. S,V , short trajectory user representation Z S,U , long trajectory interest point representation Z L,V and long trajectory user representation Z L,U The steps are as follows:
[0114] First calculate The calculation expression is as follows:
[0115]
[0116] in, Represents the l-th layer long trajectory mask hypergraph The set of interest point embeddings, W is the shared hypergraph neural network parameter matrix, represents the incidence matrix of the hypergraph after long trajectory masking, represents the diagonal node degree matrix of the hypergraph after long trajectory masking, represents the diagonal hyperedge degree matrix of the hypergraph after long trajectory masking, |Γ| represents the number of layers of the shared hypergraph neural network, and d represents the dimension of representation;
[0117] use Calculate Z L,V and Z L,U The calculation expression is as follows:
[0118]
[0119] where Γ represents the Γth layer of the long trajectory mask hypergraph, and |Γ| represents the total number of layers;
[0120] Similarly, calculation The calculation expression is as follows:
[0121]
[0122] in Represents the short trajectory hypergraph of the lth layer The interest point embedding set, D Sv Denotes the diagonal node degree matrix of the short trajectory hypergraph, H S Represents the incidence matrix of the short trajectory hypergraph, D Se Represents the diagonal hyperedge degree matrix of the short trajectory hypergraph;
[0123] use Calculate Z S,V and Z S,U The calculation expression is as follows:
[0124]
[0125] where Γ′ denotes the Γ′th layer of the short trajectory mask hypergraph and |Γ′| denotes the total number of layers.
[0126] S500: Z L,V ,Z L,U and Z S,V ,Z S,U Enter the two-level contrastive learning module:
[0127] Z L,V and Z S,V After embedding the fusion layer, the interest point fusion representation Z is obtained F,V , Z L,U and Z S,U After embedding the fusion layer, the user fusion representation Z is obtained F,U , the calculation expression is as follows:
[0128] Z F,V =Z L,V W1+Z S,V· (1-W1)
[0129] Z F,U =Z L,U W2+Z S,U· (1-W2)
[0130] in, and Both represent learnable aggregation matrices;
[0131] Z L,V ,Z L,U and Z S,V ,Z S,U After comparing the decoupled learning layers, the global loss function is constructed using the InfoNCE objective function. The InfoNCE objective function is the existing technology;
[0132] Z L,V and S u The long trajectory enhanced view representation is calculated by the contrast enhancement learning layer Z S,V and S u′ The short trajectory enhanced view representation is calculated by the contrast enhancement learning layer Then use and At the same time, the NT-Xent objective function is used to construct the local loss function
[0133] In S500, the global loss function is obtained. and local loss function The content is as follows:
[0134] Using Z S,V , Z S,U , Z L,V and Z L,U Constructing the overall loss function The calculation expression is as follows:
[0135]
[0136] Where s(·,·) is the cosine similarity function, u′≠u and u′∈U, v′≠v and v′∈V, τ is the temperature parameter;
[0137] use Calculate the local loss function The calculation expression is as follows:
[0138]
[0139] in, Denotes user u embedded using long trajectory interest point representation i The trajectory of Denotes user u embedded using short trajectory interest point representation i The trajectory representation of represents the trajectory representation of user u′ embedded using the long trajectory interest point representation, represents the trajectory representation of user u′ embedded using short trajectory interest point representation, B represents the training sample set during the training process, and Transformer is the existing technology.
[0140] S600: Looking for the S u In Z F,V , Z F,U The location information corresponding to each point of interest in the local trajectory is obtained by combining these location information. u , E u Get the prediction result through Transformer encoder Then use and points of interest v l In z F,V The corresponding representation Constructing a recommendation loss function
[0141] In S600, the recommendation loss function is obtained. The content is as follows:
[0142]
[0143] Among them, σ represents the Sigmoid function, represents the sequence representation of user u, Indicates the next real access point v n+1 The embedding representation of represents negative samples randomly sampled from POIs that user u has not visited;
[0144] Assume that the historical trajectory of user u is S′ u ={v1, v2..., v l}, E uCalculated by Transformer Among them, E u The calculation expression is as follows:
[0145]
[0146] Where l represents S′ u The length of p l Indicates the point of interest v l For the corresponding position encoding, Transformer is the existing technology.
[0147] S700: Exploitation and Constructing SHGMAE overall loss function Take S as data input, use Adam as training optimizer, and use Update SHGMAE parameters in reverse order. When the training reaches the maximum number of iterations or When it no longer changes, the training is stopped. At this time, the trained hypergraph mask POI recommendation model SHGMAE' is obtained, and its calculation expression is as follows:
[0148]
[0149] Among them, λ1 and λ2 are weight coefficients of the loss function, which are used to control the weight ratio of decoding reconstruction loss and contrastive learning loss respectively; Adam optimizer is an existing technology.
[0150] S800: Input the historical trajectory Y of the user to be predicted into SHGMAE', and output the prediction result Y' of the next point of interest of the user.
[0151] Experimental content and results
[0152] Experimental setup
[0153] 1. Dataset
[0154] This experiment uses three real-world location datasets. Specifically, the NYC and TKY datasets from Foursquare (a mobile service platform centered on user location information) record user check-in behavior in New York City (NYC) and Tokyo (TKY), respectively, from April 2012 to February 2013. Furthermore, this experiment also uses the Gowalla dataset, which contains data collected on the Gowalla platform in California and Nevada from February 2009 to October 2010.
[0155] To ensure the quality of experimental data, this experiment set filtering criteria: excluding users with fewer than 10 check-in records and locations with fewer than 10 visitors. Table 1 shows statistical information such as the number of users, number of locations, number of check-in records, number of long trajectories, number of short trajectories, average long trajectory length, average long time interval and average spatial interval, average short trajectory length, average short time interval and average spatial interval.
[0156] Table 1 Dataset details
[0157]
[0158] 2. Evaluation indicators
[0159] This experiment uses the leave-one-out evaluation strategy, widely used in sequential recommendation. Specifically, for each user's trajectory sequence, this experiment uses the last check-in location as the test location. For evaluation, two widely used recommendation performance metrics are used: NDCG@k and HR@k, where k takes values of 5, 10, and 20.
[0160] NDCG (Normalized Discounted Cumulative Gain) is a commonly used evaluation metric in recommendation systems to measure the ranking quality of recommendation lists. It normalizes the cumulative gain by considering the relevance of recommended items at different positions and the impact of their ranking on user satisfaction. i represents the relevance of the i-th item, DCG represents the discounted cumulative gain, and the calculation formula is as follows:
[0161]
[0162] The final calculation formula of normalized discounted cumulative gain NDCG is as follows:
[0163]
[0164] Where IDCG@k represents the ideal discounted cumulative gain under the optimal scenarios sorted in descending order of relevance.
[0165] Hit rate (HR@k) is defined as the ratio of the number of correctly predicted samples to the total number of samples in the prediction result list. Its core measure is the degree of match between the recommended items and user preferences, focusing on evaluating the accuracy of the prediction process. The calculation formula is as follows:
[0166]
[0167] Among them, hit(i) indicates whether the recommendation result hits the preference of user i (a value of 1 indicates a hit, and 0 indicates a miss).
[0168] 3. Baseline Model
[0169] SASRec (ICDM18): A sequential recommendation model based on the self-attention mechanism that can effectively capture long-term sequential dependencies.
[0170] SSEPT (RecSys20): A personalized Transformer model that enhances sequential recommendation by integrating user personalized embeddings.
[0171] BERT4Rec (ACM2019): uses a bidirectional Transformer architecture to learn user contextual behavior preferences through masked self-supervision tasks.
[0172] HCCF (SIGIR2022): Jointly modeling local and global collaborative relationships based on hypergraph neural networks, and designing cross-view contrastive learning for enhancement.
[0173] GETNext(SIGIR2022): A Transformer model that fuses global transfer patterns, spatiotemporal context, and category embeddings.
[0174] CLSPRec (CIKM2023): Based on the method of long-short sequence modeling and contrastive learning, users' long-term preferences and short-term interests are used as positive samples for contrastive learning.
[0175] DSDRec (Information Sciences 2024): A POI recommendation model that combines deep semantics and diffusion enhancement to simultaneously model users' long-term and short-term preferences.
[0176] MAERec (SIGIR2023): A sequential recommendation method based on the adaptive graph mask paradigm, which reduces the impact of data noise through a dynamic masking strategy.
[0177] MSTHN (DASFAA2023): Utilizes hypergraph neural networks to capture high-order location collaboration signals from a global perspective and introduces a user time preference enhancement strategy.
[0178] HyperSE (IPM2025): A method for extracting collaborative signals through global and local hypergraphs and fusing deep semantic features to enhance trajectory modeling.
[0179] 4. Experimental Details
[0180] This experiment uses the PyTorch framework to develop and train the model, using Adam as the optimizer and the learning rate set to 1e -3 , weight decay is 8e -4 , the batch size is set to 128, the embedding dimension is 128, the number of shared hypergraph neural network layers is 3, and the dropout rate is 0.3.
[0181] In the long-short trajectory shared hypergraph mask autoencoder part, the mask depth is set to {1, 3, 5}, and the number of mask anchors is The value range of is {10, 50, 100, 200}. For the two-level contrastive learning module, the temperature parameter τ is set to 0.1. In addition, the mask reconstruction loss weight λ1 and the contrast loss weight λ2 are selected from the range of {0.1-1}.
[0182] Based on the different trajectory lengths in the dataset, this experiment sets the maximum trajectory length to 200. Trajectories exceeding this threshold are truncated, and shorter trajectories are padded with zeros to a length of 200.
[0183] For all baseline methods, this experiment carefully tunes the hyperparameters according to actual conditions.
[0184] 5. Comparative Experimental Analysis
[0185] Table 2 shows the experimental results of the SHGMAE method compared with several high-quality methods on three real-world datasets: NYC, TKY, and CA. Bold text indicates the best performance in each metric, while underlined text indicates suboptimal performance. The results clearly demonstrate that SHGMAE has a significant advantage across all evaluation metrics on the three real-world datasets.
[0186] Compared to traditional recommendation methods (such as SASRec and SSEPT), graph-based methods (such as GETNext) demonstrate superior performance by integrating high-order structural information between sequences. Furthermore, self-supervised learning methods (such as BERT4Rec, HCCF, and MAERec) achieve significant performance improvements by extracting high-quality user preference representations from sparse, discrete trajectory data through specific self-supervised signal extraction mechanisms. However, this experiment found that MAERec performs poorly when processing discrete trajectory data. Although its adaptive graph masking strategy partially alleviates the noise introduced by random masking, its undirected, unweighted graph ignores the temporal and directional characteristics of user behavior, exacerbating the discrete nature of trajectories.
[0187] Furthermore, long- and short-term user behavior modeling methods (such as CLSPRec, DSDRec, and HyperSE) demonstrate greater effectiveness than traditional methods, highlighting their value in POI recommendation. Specifically, CLSPRec explores the potential of using a unified encoder to process both long and short trajectories; DSDRec innovatively leverages deep semantic information in trajectories to model user preferences across time scales; and HyperSE achieves significant performance improvements by combining a hypergraph structure with deep semantic analysis to collaboratively model long- and short-term behavior patterns.
[0188] Hypergraph-based methods (such as HyperSE, HCCF, and MSTHN) consistently outperformed other methods across all datasets, demonstrating the effectiveness of hypergraph structures for POI recommendation. These methods effectively capture complex POI relationships and interactions through high-order collaborative signals, enabling detailed modeling of deep inter-POI connections. By constructing more detailed and comprehensive representations, hypergraph models significantly improve recommendation system performance through rich pattern characterization.
[0189] The proposed SHGMAE model surpasses all baseline models across all evaluation metrics on three real-world datasets, fully demonstrating its effectiveness. This significant improvement stems from three key design considerations: First, we propose a long-trajectory hypergraph semantic consistency interaction mask, exploring the plasticity of graph mask self-supervised learning within a hypergraph network structure. Second, we employ a hypergraph data structure to model the long- and short-term trajectories of all users, while simultaneously using a shared hypergraph neural network to deeply mine the collaborative signals of global user long- and short-term behaviors. Finally, we employ two-level contrastive learning: global hypergraph contrastive learning addresses the problem of feature entanglement between different users and oversmoothing caused by the shared neural network, while local trajectory contrastive learning further enhances the inherent consistency of individual users' long- and short-term behaviors. Specifically, compared to TKY, significant performance improvements are observed on the NYC and CA datasets. As shown in Table 2, the average time interval and geographic spacing between user check-ins in the NYC and CA datasets are larger (stronger discreteness), further validating the superiority of our approach for handling discrete and sparse trajectory data.
[0190] Table 2 Comparative experiments on NYC, TKY, and CA datasets
[0191]
[0192] 6. Effects of different components
[0193] This study evaluated the contribution of each component of the SHGMAE model to the overall prediction performance through systematic ablation experiments. The comparative data is shown in Table 3. The following variant models were designed for comparative analysis:
[0194] 6.1 Removing the HGM (Long Trajectory Hypergraph Masked Autoencoder): To verify its impact on recommendation performance, this experiment removed the module. Experiments show that the absence of the HGM leads to performance degradation across all datasets, demonstrating that this method can extract robust self-supervisory signals from sparse, discrete long trajectory hypergraphs. This achieves two key effects: 1) enhancing the ability of hypergraph neural networks to capture complex point-of-interest relationships through high-order collaborative signals; and 2) further exploring the potential of hypergraph neural networks in processing sparse, discrete data.
[0195] 6.2. Removing the Shared Hypergraph Neural Network (SHG): Performance continued to deteriorate after removing this component, confirming the necessity of the SHG for collaborative modeling of both short- and long-term behaviors. This validation revealed: 1) inherent consistency and similarity in users' short- and long-term behaviors; and 2) the superiority of the SHG architecture in capturing high-level collaborative patterns.
[0196] 6.3 Using RM (Random Masking Strategy): After replacing the semantically consistent interaction mask with a random mask, the performance of all three datasets decreased. This demonstrates that the masking strategy proposed in this experiment can accurately identify key cross-hyperedge interactions in long trajectory hypergraphs. These interactions capture more robust cross-sequence transfer patterns. At the same time, the reconstruction decoding task forces the model to focus on recovering key interactions, thereby enhancing structural robustness to sparse data.
[0197] 6.4 Removal of GCL (Global Hypergraph Contrast Decoupling): Removing this module resulted in a significant performance degradation. The main reasons are: 1) the entanglement of features of different users' long-term and short-term behaviors may destroy personalized information; 2) multi-layer shared hypergraph networks may cause over-smoothing problems, resulting in excessive convergence of different users' behavior representations.
[0198] 6.5 Removing LCL (Local Trajectory Contrast Enhancement): The performance degradation indicates that this module enhances personalized trajectory representation by: 1) aligning long-term and short-term behavior patterns at the individual user level; 2) deeply exploring the intrinsic consistency of user behavior; and 3) improving representation quality to better support sequence modeling and user representation enhancement.
[0199] Table 3 Ablation experiment results of different modules
[0200]
[0201] 7. Impact of different hyperparameters
[0202] This part systematically analyzes the impact of hyperparameters on model performance, including mask reconstruction loss weight λ1, contrast loss weight λ2, number of mask candidates, and the weight of the mask reconstruction loss. The impact of mask depth K on HR@10 and NDCG@10 on NYC, TKY and CA datasets is studied, aiming to determine the optimal configuration to improve model performance across datasets.
[0203] Hypergraph Mask Autoencoder Loss Weight: The mask reconstruction loss weight λ1 significantly affects the ability of the hypergraph neural network to extract high-order collaborative information from discrete long trajectories. Figure 2 As shown, the NYC and TKY datasets from the Foursquare platform are more sensitive to weight changes. Table 1 shows that the CA dataset contains longer and more evenly distributed trajectories, indicating relatively higher data quality. Model performance steadily improves with increasing weights, empirically validating the effectiveness of the hypergraph mask autoencoder framework.
[0204] Dual Contrastive Loss Weighting: The contrastive loss weight λ2 incorporates two components: global hypergraph contrast decoupling learning and local trajectory contrast enhancement. Experiments show that on the NYC and TKY datasets, performance is stable within the weight range of 0.1-0.5, with significant improvement from 0.5-1.0. On the CA dataset, performance continues to improve across the entire weight range. This difference stems from the characteristics of the CA dataset: the higher POI density exacerbates the risk of feature entanglement during training, the greater disparity in the number of long- and short-term trajectories, and the more pronounced differentiation of user behavior patterns, which enhance the model's sensitivity to contrastive alignment.
[0205] Number of Mask Candidate Nodes: The parameter α determines the number of anchor nodes used for interaction masking in a long trajectory hypergraph. Experimental findings indicate that insufficient anchor nodes lead to inadequate masking of key interactions and degraded performance, while excessive anchor nodes compromise the structural integrity of the hypergraph. Excessive structural perturbations can disrupt model training, negatively impacting overall performance.
[0206] Mask depth: This parameter controls the maximum length of generated transactions. Experiments show that setting K = 1 (masking only interactions within 1 hop of the anchor node) leads to performance degradation. Interestingly, excessively long mask ranges can also affect reconstruction quality due to insufficient contextual information, potentially compromising the auxiliary SSL task and negatively impacting the target recommendation task.
[0207] 8. Analysis of the robustness of the model on incomplete data
[0208] This experiment simulates the sparsity problem caused by incomplete trajectory data by using only a portion of the training data (25%, 50%, 75%, and 100%), while keeping the test data unchanged. This setting aims to evaluate the performance of the model under different levels of data missingness. The experiment uses datasets from three cities: New York City, New York City, and California.
[0209] This experiment compares the performance of baseline methods (MAERec, HCCF, HyperSE, MSTHN), see Figure 3As shown. Performance comparison with baseline methods shows that SHGMAE maintains the best performance with minimal degradation under all data completeness conditions. Specifically: (1) MAERec's undirected and unweighted graph will amplify the noise in self-supervised learning under data missing conditions; (2) HCCF partially alleviates the noise through global interaction hypergraph and local graph structure combined with contrastive learning, but still has limitations when data is severely sparse; (3) HyperSE's hint-enhanced hypergraph architecture will produce a semantic gap in trajectory modeling when faced with highly incomplete data; (4) MSTHN's spatiotemporal graph integration is more sensitive to the bias caused by missing trajectory patterns. In contrast, SHGMAE demonstrates excellent ability to extract robust user behavior preferences from sparse data, which is attributed to: 1) the long trajectory hypergraph masked autoencoder enhances the ability to learn high-quality preference representations from discrete trajectories; 2) the shared hypergraph combined with the dual contrastive learning strategy effectively aligns the inherent consistency and similarity of users' long-term and short-term behavior patterns.
[0210] 9. Trajectory Cold Start Research
[0211] Short trajectories pose a special challenge to next POI recommendation due to insufficient spatiotemporal context information (especially when they only contain 1-2 check-in points). This experiment dynamically divides all trajectories by sorting them by length, defining the first 15% as long trajectories and the last 15% as short trajectories. As shown in Table 4, on the NYC dataset, our model outperforms the baseline methods (HCCF, HyperSE) in all long / medium / short trajectory groups, with the most significant performance improvement on short trajectories. This demonstrates that the model has stronger robustness and generalization ability for discrete trajectories, mainly due to two key mechanisms: (1) The long trajectory hypergraph mask autoencoder extracts more generalizable robust global collaborative signals from the hypergraph structured trajectories; (2) Our framework achieves collaborative modeling of globally distributed short trajectories through two-level contrastive learning, which can effectively align users' long-term and short-term behavior patterns even under sparse trajectory conditions.
[0212] Table 4 Performance comparison of different models in different user groups
[0213]
[0214] 10. Visualization of Embedding Representations
[0215] Contrastive learning has demonstrated excellent performance in many deep learning tasks and is widely used for data augmentation and representation space optimization. To explore the inherent mechanism of contrastive learning in this experimental model and verify the role of dual contrastive learning in enhancing the global representation of users' long-term and short-term behaviors, this experiment uses mean-based sampling followed by t-SNE dimensionality reduction visualization to show the distribution of long-term and short-term behavior embeddings of different model variants at the best performance. The final visualization results are shown below. Figure 4 shown.
[0216] The experimental results show that: when the "no sharing no contrast learning" mode is adopted (corresponding to Figure 4 (d)), there are significant differences in users' long-term and short-term behavior patterns, and their internal consistency has not been explored; when the "no sharing and comparative learning" model is adopted ( Figure 4 (c)), can better capture the internal consistency of long-term and short-term behavior patterns, proving the potential of the double contrast learning method in this experiment; when the "shared contrast learning" model is adopted ( Figure 4 (a)), the visualization shows that the internal consistency between long-term and short-term behavior representations is significantly improved, and compared with the "shared non-contrast learning" model ( Figure 4 (b)), the boundaries of behavioral patterns between different users are clearer, highlighting the effectiveness of the global contrast decoupling learning strategy.
[0217] The method proposed in this paper proposes a novel next point of interest recommendation model (SHGMAE), exploring the potential of hypergraph neural networks in modeling users' long-term and short-term behavior patterns. Specifically, to enhance the ability of hypergraph neural networks to extract robust user behavior patterns from highly discrete long trajectory data, the present invention proposes a semantic consistency interaction masking strategy. This strategy uses a hypergraph masked autoencoder for self-supervised learning, which not only strengthens the long-term user behavior representation but also captures global potential correlations across users. At the same time, a shared hypergraph neural network is used to mine high-order consistent collaborative signals between different users' long-term and short-term behavior patterns. In addition, to address the risks that may arise from shared hypergraphs, such as feature entanglement and over-smoothing between different users' long-term and short-term behavior representations, global hypergraph contrastive decoupling learning is proposed. In order to deeply explore the intrinsic consistency of individual users' long-term and short-term behavior patterns, local trajectory contrastive reinforcement learning is also designed. Comprehensive experiments on real datasets show that SHGMAE has significant advantages in processing discrete data and capturing long-term and short-term behavior patterns, and can provide more in-depth and accurate recommendations.
[0218] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not limiting. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the purpose and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A location recommendation method based on shared hypergraph masks, characterized by: The steps include: S100: Select a public user trajectory dataset S, where each user trajectory is a sample and each sample includes a user set U, a user point of interest check-in location set V, and a user visit point of interest location timestamp set T, as shown in the following expression: U={u1,u2,…,u |U| } V={v1,v2,…,v |V| } T={t1,t2,…,t |T| } Among them, |U| represents the total number of users, |V| represents the total number of POI locations, and |T| represents the total number of timestamps; S200: Construct a hypergraph mask POI recommendation model (SHGMAE). SHGMAE includes a hypergraph mask autoencoder module, a two-level contrastive learning module, and a Transformer encoder. The hypergraph mask autoencoder module includes a long-trajectory hypergraph autoencoder and a shared hypergraph autoencoder. The two-level contrastive learning module includes a contrastive decoupling learning layer, a contrastive enhancement learning layer, and an embedding fusion layer. S300: Obtain the user's long trajectory S based on S u and user short trajectory S u′ , through S u Constructing a long trajectory hypergraph By S u′ Constructing a short trajectory hypergraph S400: As the input of the long trajectory hypergraph autoencoder, the output is the long trajectory mask hypergraph Then After decoding and reconstruction by the multi-layer perceptron MLP, the long trajectory hypergraph autoencoder objective function is obtained Will and As the input of the shared hypergraph autoencoder, the outputs are The corresponding short trajectory interest point representation Z S,V and short trajectory user representation Z S,U ,as well as The corresponding long trajectory interest point representation Z L,V and long trajectory user representation Z L,U ; S500: Z L,V ,Z L,U and Z S,V ,Z S,U Enter the two-level contrastive learning module: Z L,V and Z S,V After embedding the fusion layer, the interest point fusion representation Z is obtained F,V , Z L,U and Z S,U After embedding the fusion layer, the user fusion representation Z is obtained F,U , the calculation expression is as follows: WITH F,V =Z L,V ·W1+Z S,V (1-W1) WITH F,U =Z L,U ·W2+Z S,U (1-W2) in, and Both represent learnable aggregation matrices; Z L,V ,Z L,U and Z S,V ,Z S,U After comparing the decoupled learning layers, the global loss function is constructed using the InfoNCE objective function. Z L,V and S u The long trajectory enhanced view representation is calculated by the contrast enhancement learning layer Z S,V and S u′ The short trajectory enhanced view representation is calculated by the contrast enhancement learning layer Then use and At the same time, the NT-Xent objective function is used to construct the local loss function S600: Looking for the S u In Z F,V 、Z F,U The location information corresponding to each point of interest in the local trajectory is obtained by combining these location information. u , E u Get the prediction result through Transformer encoder Then use and points of interest v l In z F,V The corresponding representation Constructing a recommendation loss function S700: Exploitation and Constructing the SHGMAE overall loss function Take S as data input, use Adam as training optimizer, and use Update SHGMAE parameters in reverse order. When the training reaches the maximum number of iterations or When it no longer changes, the training is stopped. At this time, the trained hypergraph mask POI recommendation model SHGMAE' is obtained, and its calculation expression is as follows: Among them, λ1 and λ2 are weight coefficients of the loss function, which are used to control the weight ratio of decoding reconstruction loss and contrastive learning loss respectively; S800: Input the historical trajectory Y of the user to be predicted into SHGMAE', and output the prediction result Y' of the next point of interest of the user.
2. The location recommendation method based on shared hypergraph mask according to claim 1, characterized in that: The long trajectory hypergraph is constructed in S300 and short-trajectory hypergraphs The content is as follows: Define the user's check-in location at a point of interest as a hypergraph node v, and define the trajectory formed by all the user's check-in locations at points of interest as a hypergraph hyperedge e; and The expression is: in, represents the set of nodes of the short-trajectory hypergraph, Represents the node set of the long trajectory hypergraph, ε S represents the set of hyperedges in the short trajectory hypergraph and ε L Represents the set of hyperedges in a long trajectory hypergraph; For each v∈e on the long trajectory, the node degree corresponding to v is defined as Among them, W e Represents the specified positive weights, all positive weights form a diagonal matrix Use d(v) to form the diagonal node degree matrix D Lv ; For each e∈ε of the long trajectory L , the corresponding hyperedge degree of e is Use d(e) to form the diagonal hyperedge degree matrix D Le ;D Lv and D Le Combine to get a long trajectory hypergraph in, Similarly, we get the short trajectory hypergraph 3. The location recommendation method based on shared hypergraph mask according to claim 2, characterized in that: The objective function of the long trajectory hypergraph autoencoder is obtained in S400 The steps are as follows: S410: Embed Middle and back, right Embed The semantic consistency calculation of the result is as follows: Where γ(v) represents v∈v L The semantic relevance score between the corresponding k-order transfer sub-hypergraph, represents the set of k-hop neighbors of v, v″ and represents the neighbor node of v, z L,v represents the embedding representation of v, z L,v″ represents the embedding representation of v″; S411: Set a semantic relevance score threshold, and obtain the key anchor node set from the node set corresponding to all γ(v)s with scores higher than the semantic relevance score threshold S412: Calculate interaction mask ε L,m , the calculation expression is as follows: ε L,m ~RandomWalk(V α ,l walk ) Among them, RandomWalk is a random walk strategy, l walk represents the length of the random walk; Using ε L,m Obtaining long trajectory mask hypergraph The calculation expression is as follows: Among them, ε L,m Represents the set of hyperedges in the long trajectory mask hypergraph; S413: Using MLP Perform decoding and reconstruction to obtain the long trajectory hypergraph autoencoder objective function The calculation expression is as follows: in, represents the positive sample loss, represents the negative sample loss, H L + Represents the set of interactive positive samples, H L - Represents the set of negative samples of interaction, |H + | indicates that H L + The number of positive samples sampled in |h - | indicates that H L - The number of negative samples sampled, u + represents the positive sample user, v + Represents the positive sample interest point node, u - represents negative sample users, v - Represents the negative sample interest point node.
4. The method for location recommendation based on shared hypergraph mask according to claim 3, wherein: In the step S400, the short trajectory interest point representation Z is output. S,U , short trajectory user representation Z S,U , long trajectory interest point representation Z L,V and long trajectory user representation Z L,U The steps are as follows: First calculate The calculation expression is as follows: in, Represents the l-th layer long trajectory mask hypergraph The set of interest point embeddings, W is the shared hypergraph neural network parameter matrix, represents the incidence matrix of the hypergraph after long trajectory masking, represents the diagonal node degree matrix of the hypergraph after long trajectory masking, represents the diagonal hyperedge degree matrix of the hypergraph after long trajectory masking, |Γ| represents the number of layers of the shared hypergraph neural network, and d represents the dimension of representation; use Calculate Z L,V and Z L,U The calculation expression is as follows: where Γ represents the Γth layer of the long trajectory mask hypergraph, and |Γ| represents the total number of layers; Similarly, calculation The calculation expression is as follows: in, Represents the short trajectory hypergraph of the lth layer The interest point embedding set, D Sv Denotes the diagonal node degree matrix of the short trajectory hypergraph, H S Represents the incidence matrix of the short trajectory hypergraph, D Se represents the diagonal hyperedge degree matrix of the short trajectory hypergraph; use Calculate Z S,V and Z S,U The calculation expression is as follows: where Γ′ denotes the Γ′th layer of the short trajectory mask hypergraph and |Γ′| denotes the total number of layers.
5. The method for location recommendation based on shared hypergraph mask according to claim 4, characterized in that: In S500, the global loss function is obtained. and local loss function The content is as follows: Using Z S,V 、Z S,U 、Z L,V and Z L,U Constructing the overall loss function The calculation expression is as follows: Where s(·,·) is the cosine similarity function, u′≠u and u′∈U, v′≠v and v′∈V, τ is the temperature parameter; use Calculate the local loss function The calculation expression is as follows: in, Denotes user u embedded using long trajectory interest point representation i The trajectory of Denotes user u embedded using short trajectory interest point representation i The trajectory representation of represents the trajectory representation of user u′ embedded using the long trajectory interest point representation, represents the trajectory representation of user u′ embedded using the short trajectory interest point representation, and B represents the training sample set during the training process.
6. The method for location recommendation based on shared hypergraph mask according to claim 5, characterized in that: In S600, the recommendation loss function is obtained. The content is as follows: Among them, σ represents the Sigmoid function, represents the sequence representation of user u, Indicates the next real access point v n+1 The embedding representation of represents negative samples randomly sampled from POIs that user u has not visited; Assume that the historical trajectory of user u is S′ u ={v1, v2..., v l }, E u Calculated by Transformer Among them, E u The calculation expression is as follows: Where l represents S′ u The length of p l Indicates the point of interest v l The corresponding position code.
Citation Information
Cited By
Unsupervised recommendation system anomaly detection method based on multi-scale behavior modeling and boundary perception enhancement
CN121188669A
An unsupervised recommendation system anomaly detection method based on multi-scale behavior modeling and boundary perception enhancement
CN121188669B