A point of interest check-in sequence generation method based on a diffusion model
By using spatiotemporal lossless coding based on a diffusion model and a conditional U-shaped network, combined with self-attention mechanism and contrastive learning, the problems of incomplete generation and noise interference in existing technologies are solved, and high-quality point of interest check-in sequence generation is achieved.
Patent Information
- Application Number
- CN202411931849.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2044-12-26
AI Technical Summary
Existing technologies struggle to generate complete and high-quality point-of-interest (POI) check-in sequences, fail to adequately consider spatiotemporal correlations, struggle to handle trajectory data of varying lengths, and may introduce noise, raising privacy concerns.
We employ a diffusion model-based approach, combining spatiotemporal lossless coding and conditional U-shaped networks with self-attention mechanisms and contrastive learning strategies to capture the spatiotemporal correlation of check-in sequences and generate equivalent data analysis results.
It effectively handles check-in sequences of variable length, captures spatial and temporal context information, and generates check-in sequences with high similarity to real data, thus improving the quality and accuracy of the generated sequences.
Smart Images

Figure CN120011656B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of spatiotemporal data mining and deep learning, and relates to a point of interest check-in sequence generation method based on a diffusion model. BACKGROUND
[0002] The check-in sequence generation task belongs to the research field of "spatiotemporal data generation". The existing published technical solutions for spatiotemporal data generation include the following, and their shortcomings are also described.
[0003] (1) A next POI recommendation method based on user preferences and spatiotemporal context information (CN117194763A), acquires user check-in records for preprocessing, uses low-dimensional dense vectors to perform vector embedding on points of interest and various auxiliary information, constructs and trains a next point of interest recommendation model based on user preferences and spatiotemporal context information, inputs the user's long-term check-in sequence and short-term check-in sequence, generates k points of interest, and recommends them to the user; but this method can only generate the next point of interest of the user, and cannot generate a complete point of interest check-in sequence. Although this method introduces spatiotemporal context information to improve recommendation accuracy, it does not fully consider the spatiotemporal correlation in the point of interest check-in sequence, which may lead to a mismatch between the recommended results and the actual situation of the user.
[0004] (2) A personnel activity trajectory and landing point automatic generation method and system (CN111985452A), comprising: determining the information of the personnel to be analyzed and the vehicle information of the personnel to be analyzed and their relationship persons; determining the first activity trajectory of the vehicle of the personnel to be analyzed in the set time period based on the card mouth information passed by the vehicle in the set time period; determining the trip of the personnel to be analyzed and the key point information in all trips based on the activity trajectory; confirming the landing point information of the personnel to be analyzed according to the key point position information. This method relies on vehicle information and existing places and equipment, which may lead to inaccurate generation of activity trajectory and landing point information for some personnel, and may be affected by incomplete data and privacy issues; at the same time, the method mainly determines the activity trajectory based on the card mouth information passed by the vehicle, and may not be able to generate accurate information for the case where there is no vehicle or the vehicle does not pass through the card mouth.
[0005] (3) A vehicle trajectory generation method (CN110223515B) proposes a vehicle trajectory generation method based on GAN. Step 1, data processing stage, the data processing stage is to first preprocess the trajectory data and map data; Step 2, data generation model stage, the data generation model stage includes generating road segment trajectory generation model and trip trajectory generation model; Step 3, data set generation stage, the data set generation stage is to load the road segment trajectory generation model and trip trajectory generation model to obtain trajectory data. Since the length of the check-in sequence is not fixed, this method is difficult to effectively process trajectory data of different lengths. This method requires fixed-length input data, so when processing trajectory data of different lengths, padding or truncation operations may be required. However, these operations may introduce additional noise, affecting the accuracy and quality of the generated trajectory; in addition, due to the extreme instability of GAN training, the generated results may not be true or unreasonable.
[0006] In summary, in the published technical solutions, the spatio-temporal correlation in the interest point check-in sequence is not fully considered, and the existing places and devices are relied on, making it difficult to effectively process trajectory data of different lengths, resulting in the inability to generate complete and high-quality interest point check-in sequences.
[0007] The development of wireless network technology enables individual mobile events to be detected with high precision. These records are called interest point check-in sequences, which provide feasibility for fully understanding urban population mobility. By extracting the high-level semantics of individual mobile events, it can be applied to interest point recommendation, business location selection, time prediction and other downstream tasks. However, directly using real-life check-in sequences to support downstream tasks will inevitably raise privacy issues, making it difficult to obtain large-scale publicly available data on human activity.
[0008] Specific details of the data preprocessing part: introduction of the source data set:
[0009] Canberra University (Canberra) wireless network data set.
[0010] (1) Data set content
[0011] This data set records the connection location information, connection bandwidth and connection duration of the free wireless network connection of teachers and students in Canberra University, which can reflect the user behavior of the check-in sequence data. The data is stored in the form of a CSV file, and the main data fields are as follows:
[0012] Canberra_checkins.csv
[0013] This file records each user's access to AP records, including access location information, access time and access duration, etc.
[0014]
[0015] (2) Dataset size
[0016] The downloaded dataset contains 215527 wireless network access records, which correspond to 4441 users and 317 AP access points after classification.
[0017]
[0018] Dartmouth wireless network usage dataset.
[0019] (1) Dataset content
[0020] This dataset records the wireless network usage of Dartmouth College students, involving 476 wireless network access points, covering 161 buildings of Dartmouth College. The data is stored in CSV files (two-dimensional tables), and the main data fields are as follows:
[0021] AP_Locations.csv, which records the geographical coordinates corresponding to each AP (wireless network access point) number.
[0022]
[0023] [ID].csv, there are several, recording the AP access records of each user, stored in the folder named "2001-2003", where [ID] is the number of the corresponding user.
[0024]
[0025] (2) Dataset size, the downloaded dataset contains 623 AP access point numbers (including some AP access point data with missing values), and 6202 users, with a total of 193958 records.
[0026]
[0027] Weeplace dataset:
[0028] (1) Dataset content, this dataset records the check-in activities of users on a location-based social platform. The data is stored in CSV files, and the main fields are as follows:
[0029] Weeplace_checkins.csv
[0030]
[0031]
[0032] (2) Dataset size: The downloaded dataset contains 1097 AP access point numbers (including some AP access point data with missing values) and 1432 users, with a total of 3041596 records.
[0033]
[0034] Gowalla dataset:
[0035] (1) Dataset content: This dataset is similar to the Weeplace dataset, both of which record the check-in activities of users on a location-based social platform. The data is stored in CSV format, and the main fields are as follows:
[0036] Gowalla_checkins.csv
[0037]
[0038] (2) Dataset size: The downloaded dataset contains 3028 AP access point numbers (including some AP access point data with missing values) and 3286 users, with a total of 2148575 records.
[0039]
[0040] Data cleaning process: Due to the varying quality of records in the directly obtained dataset, a series of cleaning operations are needed to remove records with missing values in the dataset and to filter users with high-quality check-in sequences for subsequent model training.
[0041] All datasets follow a unified processing flow, and the common fields in the above datasets are as follows:
[0042]
[0043] Data filtering;
[0044] (1) Remove users who do not contain trajectory point data after filtering (i.e., remove empty CSV files), and obtain valid users, i.e., users with at least 1 trajectory point;
[0045] (2) Remove data with SESSION_DURATION values less than 3 (connection duration less than 3 minutes, recognized as invalid connection);
[0046] (3) Delete the data whose AVG_KBPS value is less than 1 (the bandwidth less than 1 kbps cannot perform normal network communication, and is regarded as invalid connection).
[0047] The filtered data all satisfy SESSION_DURATION value greater than or equal to 3, and AVG_KBPS value greater than or equal to 1.
[0048] Data descrambling: the value of the LOCATION_CODE field of the continuous data whose length is greater than or equal to 4 and jumps back and forth between 2 AP connection points is uniformly modified to the LOCATION_CODE value of the data whose SESSION_DURATION value is the largest.
[0049]
[0050] Data merging;
[0051] (1) Aggregation with day granularity:
[0052] According to the field CONNECT_DATE, the connection data of the same day is merged into one piece of connection data with day granularity, and in the merged connection data:
[0053] The value of CONNECT_DATE is the date of the day (format: Y / m / d);
[0054] The value of SESSION_DURATION is the sum of the connection data in the same day;
[0055] The value of AVG_KBPS is the weighted sum of the connection data in the same day (the weight is the proportion of SESSION_DURATION);
[0056] The values of the remaining fields are equal to the values of the fields corresponding to the data whose SESSION_DURATION value is the largest.
[0057] (2) Merge adjacent same AP records:
[0058] The data of the user's WiFi access within 2 hours in the same AP is merged into one piece of data, and the field values of the merged new data are as follows:
[0059] The value of CONNECT_DATE is the earliest date (format: Y / m / d H:M:S) year / month / day hour:minute:second in the data to be merged originally;
[0060] The value of SESSION_DURATION is the sum of the values of the corresponding fields of the data to be merged originally;
[0061] The value of AVG_KBPS is the weighted sum of the corresponding field values in the data to be merged (the weight is the proportion of SESSION_DURATION) ;
[0062] The values of the remaining fields are equal to the values of the corresponding fields of the data with the largest SESSION_DURATION value among the original data to be merged.
[0063] Data processing result;
[0064] After the data set is preprocessed, users with high-quality check-in sequences (the length of the check-in sequence in a day is between 10 and 25) are screened out, and the data scale after screening is as follows:
[0065] SUMMARY
[0066] The present application provides a point of interest check-in sequence generation method based on a diffusion model, which generates sequences by learning real sequence distribution or supplementing real sequences, obtains equivalent data analysis results through the generated sequences, and supports high-level semantic modeling.
[0067] A point of interest check-in sequence generation method based on a diffusion model, comprising the following steps:
[0068] Step 1, data preprocessing, cleaning and smoothing operation on real world data set, to ensure data quality and consistency.
[0069] Step 2, lossless spatio-temporal encoding, converting check-in sequences of different lengths into check-in vectors of equal length, encoding through spatial frequency vectors and time bucket vectors, and retaining the information of the original sequence.
[0070] Step 3, establish diffusion model, construct spatial diffusion module and time diffusion module, capture spatio-temporal features by using forward diffusion process and reverse reconstruction process.
[0071] Step 4, introduce conditional U-shaped network in the diffusion module, propose a denoising network for capturing complex spatio-temporal correlation, and model through self-attention mechanism.
[0072] Step 5, use contrastive learning strategy, adopt ternary contrastive learning to further capture the spatio-temporal correlation of the check-in sequence, and strengthen the connection between the time and space diffusion modules.
[0073] The advantages of the present application are: it can effectively solve the problems of different input encoding lengths, difficulty in capturing spatio-temporal correlation, and noise interference. The method is used for point of interest check-in sequence generation, and the effect is remarkable.
[0074] Table 1 comparison on four real world data sets
[0075]
[0076]
[0077] Table 1 shows the performance of the invented model on four real-world datasets.
[0078] Table 1 shows the performance comparison of the invented model on four real-world datasets, using different metrics to evaluate the performance of the model. These metrics include JSD-all, JSD-t, JSD-r, and JSD-u.
[0079] JSD-all represents the overall Jensen-Shannon distance, measuring the similarity between the generated check-in sequences and the real data.
[0080] A lower JSD-all value indicates that the model-generated sequences are closer to the real data, and the performance of the model is better.
[0081] JSD-t represents the Jensen-Shannon distance in the time dimension, evaluating the difference in time distribution between the model-generated check-in sequences and the real data.
[0082] A lower JSD-t value indicates that the model performs better in time generation.
[0083] JSD-r represents the Jensen-Shannon distance in the spatial dimension, evaluating the difference in spatial distribution between the model-generated check-in sequences and the real data. A lower JSD-r value indicates that the model performs better in spatial generation.
[0084] JSD-u represents the Jensen-Shannon distance in the user dimension, evaluating the difference in user distribution between the model-generated check-in sequences and the real data.
[0085] A lower JSD-u value indicates that the model performs better in user generation.
[0086] From the table, it can be seen that on the four datasets, the invented model shows relatively low values in JSD-all, JSD-t, JSD-r, and JSD-u metrics, indicating that the model has a high similarity between the generated check-in sequences and the real data, and has good performance.
[0087] Compared with the prior art, the invention has the following advantages:
[0088] Strong processing ability for non-fixed length sequences: The present technology has stronger processing ability for non-fixed length check-in sequences. By adopting the space-time lossless coding technology, the present method can effectively process check-in sequences of different lengths without introducing additional noise or losing key information.
[0089] Efficient capture of spatial and temporal context information: The present technology utilizes two different diffusion modules to capture temporal and spatial context information, ensuring that the generated check-in sequences are more realistic.
[0090] Efficient capture of spatial and temporal correlation: The present technology employs a contrastive learning strategy to capture the temporal and spatial correlation of the check-in sequence, strengthening the connection between the temporal and spatial diffusion modules.
[0091] Effect of decoupling strategy:
[0092] To demonstrate the necessity of adopting the decoupling strategy, the spatial and temporal features are intentionally combined without being separated. In this configuration, only one denoising network is used to generate the check-in sequence without incorporating contrastive learning or additional conditions. The remaining settings remain consistent with STCDM. This setup allows the evaluation of the effectiveness of decoupling generation. As shown in Figure 5a 、 Figure 5b 、 Figure 5c 、 Figure 5d When the temporal and spatial features are not separated, the noise can interfere with each other. Additionally, the temporal and spatial features exhibit significant differences. Mixing the spatial and temporal features together affects the model's ability to capture their characteristics. The final result is even worse than many baseline models. The difference is greater compared to the performance of Diff-Traj. This indicates that decoupling modeling significantly affects the overall effectiveness of the model. This suggests that relying solely on a single denoising network is insufficient to effectively model spatial-temporal correlation. After decoupling, the effective spatial-temporal correlation strategy proposed by the model can significantly improve the quality of the generated check-in sequences. This also indicates that the denoising network of Diff-Traj is more suitable for this specific setting compared to CUnet, but it is difficult to achieve further improvements. The denoising network of Diff-Traj, when combined with the decoupling framework, can exhibit better performance.
[0093] Ablation experiments:
[0094] To further evaluate the effectiveness of different components in STCDM, the four variants are compared with the STCDM model. Ablation experiments are conducted, and the experimental results for all datasets are analyzed.
[0095] Removing conditions and contrastive learning (w / o Cond\&Cont): The conditional information is removed from the denoising network. The input and temporal embedding are directly used to predict the noise. Contrastive learning is removed. The remaining settings are the same as STCDM.
[0096] Remove condition (w / o Cond): The condition information is removed from the denoising network. The input and temporal embedding are directly used to predict the noise. The rest of the settings are the same as STCDM.
[0097] Remove contrastive learning (w / o Cont): The contrastive loss is directly removed. The rest of the settings are the same as STCDM. This setting is used to evaluate the effectiveness of contrastive learning from the sequence level.
[0098] Remove CUnet (w / o CUnet): A normal Unet is used as the denoising network instead of CUnet. The rest of the settings are the same as STCDM. This setting is used to evaluate the function of CUnet.
[0099] Figure 6a 、 Figure 6b 、 Figure 6c 、 Figure 6d The results of Table 1 show that the two diffusion modules and the contrastive learning design of STCDM play an important role in modeling the spatial-temporal correlation. These methods effectively capture the spatial-temporal correlation from their different spatial and temporal features. At the same time, the ability to generate high-quality check-in sequences relies on the unique denoising network design. In summary, each module and block of the design contributes to improving the quality of the generated check-in sequences. The superior combination of these modules greatly enhances the performance of the model and the authenticity of the generated sequences.
[0100] To compare the generated results more intuitively, the model of STCDM is visualized with Diff-Traj, focusing on two aspects of the Dartmouth dataset. First, the visualization of the number of visits to 256 POIs selected from the Dartmouth dataset is presented, providing an overview of the distribution of visit frequencies. As shown in Figures 1 and 2, Figure 7a 、 Figure 7b 、 Figure 7c and Figure 7d .
[0101] Figure 7a Real-world: The distribution of the sequence in the real world.
[0102] Figure 7b STCDM: The point of interest check-in sequence generation method based on the diffusion model proposed in the present invention. That is, the distribution of the user sequence generated by the STCDM method.
[0103] Figure 7c Diff-Traj: The distribution of data generated by one of the baseline models named Diff-Traj
[0104] Figure 7d Real: In the legend of the chart, it represents the distribution of real data.
[0105] STCDM: The proposed point-of-interest check-in sequence generation method based on the diffusion model in the present application.
[0106] Visit density in a day: The distribution of different models and real data in a day.
[0107] The check-in sequences generated by the model are more similar to the spatial distribution observed in actual situations. Secondly, the visit time distribution of a specific POI is presented. Compared with Diff-Traj, the model generates a visit time distribution that better captures the patterns observed in actual situations. These cases highlight the significant advantages of the model in capturing the spatial-temporal distribution of generated check-in sequences. They demonstrate the ability of the model to effectively capture spatial-temporal correlations and generate more realistic check-in sequences. BRIEF DESCRIPTION OF DRAWINGS
[0108] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor. As shown in the drawings:
[0109] Figure 1 The spatiotemporal contrast diffusion model framework of the present application.
[0110] Figure 2 The spatiotemporal lossless coding method of the present application.
[0111] Figure 3 The conditional U-shaped network of the present application.
[0112] Figure 4 The contrast learning process of the present application.
[0113] Figure 5a One of the decoupling experiments of the present application.
[0114] Figure 5b The second of the decoupling experiments of the present application.
[0115] Figure 5c The third of the decoupling experiments of the present application.
[0116] Figure 5d The fourth of the decoupling experiments of the present application.
[0117] Figure 6a One of the ablation experiment results of the present application.
[0118] Figure 6bResult 2 of ablation experiment of the present application.
[0119] Figure 6c Result 3 of ablation experiment of the present application.
[0120] Figure 6d Result 4 of ablation experiment of the present application.
[0121] Figure 7a Visualization comparison 1 of the present application.
[0122] Figure 7b Visualization comparison 2 of the present application.
[0123] Figure 7c Visualization comparison 3 of the present application.
[0124] Figure 7d Visualization comparison 4 of the present application.
[0125] Explanation of foreign language in the figure:
[0126] Canberra: refers to the wireless network access dataset of the University of Canberra.
[0127] Dartmouth: refers to the wireless network access dataset of Dartmouth College.
[0128] Weeplace: this is the name of a dataset recording urban user wireless network access data.
[0129] Gowalla: this is a well-known geolocation-based social network dataset.
[0130] STCDM: the abbreviation of the Spatial-Temporal Conditional Diffusion Model, which is the interest point check-in sequence generation method based on the diffusion model proposed in the present application.
[0131] w / o Cond&Cont: the abbreviation of "without Condition and Content", indicating a model without condition and content.
[0132] w / o Cond: the abbreviation of "without Condition", indicating a model without condition.
[0133] w / o Cont: the abbreviation of "without Content", indicating a model without content.
[0134] w / o STUnet: the abbreviation of "without Spatio-Temporal U-net", indicating a model without spatio-temporal U-net.
[0135] w / o disentanglement: Non-decoupling mode.
[0136] JSD-all: Used to measure the similarity between model-generated sequences and real data in all aspects.
[0137] JSD-t: A measure of the similarity between model-generated sequences and real data over time.
[0138] JSD-r: A measure of the similarity between model-generated sequences and real data in the spatial dimension.
[0139] JSD-u: Measures the similarity between model-generated sequences and real data based on user-related features.
[0140] Real-world: The distribution of real-world data.
[0141] Diff-Traj: The data distribution generated by one of the baseline models named Diff-Traj.
[0142] Visit density in a day: The distribution of different models and real data throughout the day. Detailed Implementation
[0143] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0144] Example 1: As Figure 1 , Figure 2 , Figure 3 , Figure 4 , Figure 5a , Figure 5b , Figure 5c , Figure 5d , Figure 6a , Figure 6b , Figure 6c , Figure 6d , Figure 7a , Figure 7b , Figure 7c and Figure 7d As shown, an interest point check-in sequence generation method based on a diffusion model is proposed. The model learns a parameterized denoising network and, based on spatiotemporal mutual information, gradually denoises the noise sampled from the prior distribution, thereby generating a high-quality check-in sequence. The overall framework of the model is as follows: Figure 1 As shown.
[0145] To better illustrate with examples, based on point-of-interest check-in data, the following definitions are made:
[0146] Interest Point Check-in Sequence c: The interest point check-in sequence c is defined as a sequence containing check-in points c = <(s1,τ1),(s2,τ2),…,(s m ,τ m ),…,(s M ,τ M )>.
[0147] Where M is the length of the check-in sequence.
[0148] s m ∈S is the index number of a POI (Point of Interest), and S is a set of POIs containing L POIs, i.e., |S| = L.
[0149] m: is a non-negative integer.
[0150] s1: The index number of the first POI (Point of Interest).
[0151] s m : The index number of the m-th POI (Point of Interest).
[0152] s M : The index number of the Mth POI (Point of Interest).
[0153] τ1: Index number of the first arrival time slot.
[0154] τ m : Index number of the m-th arrival time slot.
[0155] τ M : Index number of the Mth arrival time slot.
[0156] The total check-in dataset C is a set containing check-in sequences c, i.e., c∈C. Hereinafter referred to as check-in sequences. Given a real-world check-in dataset, the goal of this problem is to train a diffusion model that can generate a synthetic check-in dataset whose distribution is similar to that of the original check-in sequences.
[0157] The parameters are defined as follows:
[0158] L: The total number of points of interest (POIs) in the dataset.
[0159] The number of time slots.
[0160] T: Total number of diffusion steps.
[0161] t: the step in the diffusion process.
[0162] (s, τ): Check-in sequence element, i.e., the index number of the point of interest and the index number of the arrival time slot.
[0163] s m : Index number of the point of interest (POI).
[0164] τ m : Index number of the arrival time slot, indicating a specific time period.
[0165] Time bucket of the check-in sequence.
[0166] x0: A check-in vector.
[0167] Spatial frequency vector of the check-in sequence.
[0168] Time bucket vector of the check-in sequence.
[0169] Generated spatial positive samples.
[0170] Generated spatial negative samples.
[0171] Generated temporal positive samples.
[0172] Generated temporal negative samples.
[0173] Loss of the spatial diffusion module.
[0174] Loss of the temporal diffusion module.
[0175] L C (θ s ): Spatial contrast loss.
[0176] L C (θ τ ): Temporal contrast loss.
[0177] λ: Weight of the contrast loss.
[0178] Spatial CUnet network.
[0179] Temporal CUnet network.
[0180] θ s : Parameters of the spatial CUnet network.
[0181] θ τ: Parameters of the temporal CUnet network.
[0182] A: An anchor sample.
[0183] P: A positive sample.
[0184] N: A negative sample.
[0185] Standard Gaussian distribution.
[0186] ξ: Asymmetric time interval.
[0187] A check-in sequence generation method based on a spatiotemporal contrast diffusion model, comprising the following steps:
[0188] Step 1, data preprocessing, cleaning and smoothing the real world dataset to ensure data quality and consistency.
[0189] Step 2, perform spatiotemporal lossless encoding, convert different length check-in sequences into equal length check-in vectors, encode through spatial frequency vectors and time bucket vectors, and retain the original sequence information.
[0190] Step 3, establish a diffusion model, construct a spatial diffusion module and a temporal diffusion module, and capture spatiotemporal features using forward diffusion and backward reconstruction processes.
[0191] Step 4, introduce a conditional U-shaped network in the diffusion module, propose a denoising network to capture complex spatiotemporal correlations, and model through self-attention mechanism.
[0192] Step 5, use a contrast learning strategy, adopt a triple contrast learning to further capture the spatiotemporal correlation of the check-in sequence, and strengthen the connection between the time and space diffusion modules.
[0193] Step 1 of data preprocessing, comprising the following steps: data preprocessing is performed on the obtained real world dataset.
[0194] These datasets contain user access sequences to various POIs, fully reflecting user behavior in different environments. Multiple preprocessing operations are performed on the original check-in sequence of each dataset.
[0195] First, data cleaning is performed by eliminating outliers and deleting check-in points with missing values or connection bandwidth less than 1 kbps (rate). Next, the data smoothing technique is applied by considering consecutive records with connection duration difference less than 1 hour as the same POI, as long as they only switch between two interest points. Finally, adjacent records with the same interest point and smaller time interval are merged to further improve the quality of the dataset.
[0196] Step 2 is performed as a lossless encoding in space-time, including the following steps: obtaining an equal-length check-in vector,
[0197] First, the original check-in sequence c of length M is split into a spatial sequence s = <s1, s2, …, sm, …, sM> and a temporal sequence τ = <τ1, τ2, …, τm, …, τM>. m ,…,s M > and time sequence τ = <τ1, τ2, …, τm, …, τM>. m ,…,τ M >.
[0198] s1: index number of the 1st POI (Point of Interest).
[0199] s m : index number of the mth POI (Point of Interest).
[0200] s M : index number of the Mth POI (Point of Interest).
[0201] τ1: index number of the 1st arrival time slot.
[0202] τ m : index number of the mth arrival time slot.
[0203] τ M : index number of the Mth arrival time slot.
[0204] POI check-in sequence c: POI check-in sequence c is defined as a sequence of check-in points c = <(s1, τ1), (s2, τ2), …, (sm, τm), …, (sM, τM)>. m m , …, (s M , τ M )>.
[0205] Where M is the length of the check-in sequence.
[0206] s m ∈ S is the index number of a POI (Point of Interest), and S is a POI set containing L POIs, i.e., |S| = L.
[0207] τ m is the index number of the arrival time slot, representing a specific time period.
[0208] Then, the spatial sequence s and the temporal sequence τ are encoded into equal-length spatial frequency vector and temporal bucket vector
[0209] These vectors can be decoded into the original sequence without losing information.
[0210] This shows that an equivalent conversion can be made between the check-in sequence and the check-in vector.
[0211] In particular, the spatial frequency vector is obtained by calculating the visiting frequency of each POI in the sequence.
[0212] The i-th element of it is defined as:
[0213] where i = 0, 1,..., L
[0214] where L is the total number of POIs, M is the length of this check-in sequence, i # denotes the i-th POI, and F is an indicator function. If s m equals i # , then F = 1, otherwise F = 0.
[0215] For example, as Figure 2 shown, from a check-in sequence c = generated from the Canberra dataset,
[0216] < (s0, τ0), (s1, τ1),..., (s 10 , τ 10 ) >.
[0217] s1: the index number of the 1st POI (Point of Interest).
[0218] s m : the index number of the m-th POI (Point of Interest).
[0219] s M : the index number of the M-th POI (Point of Interest).
[0220] τ1: the index number of the 1st arrival time slot.
[0221] τ m : the index number of the m-th arrival time slot.
[0222] τ M : the index number of the M-th arrival time slot.
[0223] By calculating the visiting frequency of each POI in c, we know that he visited the 1st POI once, the 2nd POI three times, the 314th POI five times, and the 315th POI twice.
[0224] In addition, -1 is used to represent that the corresponding POI was not visited.
[0225] Next, the time bucket vector is introduced. #Construct a corresponding time bucket list L i With the time slot of accessing the POI recorded:
[0226]
[0227] τ j : The index number of the jth time slot.
[0228] j: The subscript of the point of interest sequence.
[0229] s j : The index number of the jth point of interest POI (point of interest).
[0230] i # : Represents the ith POI.
[0231] Indicates the time list constructed for each POI.
[0232] Indicates the time list constructed for the ith POI.
[0233] For example, as shown in Figure 2 , the user accessed the 2nd POI three times in the 10th, 12th, and 22nd time slots, so
[0234] Then, a new numerical processing method is adopted, which can convert each time bucket list into a positive integer and restore the original without losing information.
[0235] Time bucket conversion: Specifically, first convert the index number of each time slot in into binary form. These binary numbers are padded with zeros on the left to form bits.
[0236] Here, ceil(·) represents the rounding up operation, is the logarithm of with base 2. Finally, concatenate these binary numbers into an aggregated binary number, and convert the aggregated binary number into a positive decimal using the binary conversion method as
[0237] i: Represents the index number of the ith POI.
[0238] τ: The superscript τ represents the time dimension.
[0239] In addition, -1 is used to represent that the corresponding POI is not accessed.
[0240] Time bucket recovery: On the other hand, the positive integer is recovered to the original time bucket list L i Involving the following steps:
[0241] Firstly, the positive decimal is converted to binary, and if the number of bits in binary is less than υ·ceil(log2(t)), zero is filled on the left. Here, υ is the number of times to reach i # , the binary is equally divided into v segments, each segment is converted from binary format to the index number of the time slot in decimal, and finally, all the index numbers of the time slot are combined into the original time bucket list L i .
[0242] In summary, by implementing the spatio-temporal lossless coding, the actual inputs of the spatial diffusion module and the temporal diffusion module are obtained, i.e. the spatial frequency vector and the time bucket vector
[0243] Refers to the 1st element in the spatial frequency vector.
[0244] Refers to the Lth element in the spatial frequency vector.
[0245] Refers to the 1st element in the time bucket vector.
[0246] Refers to the Lth element in the time bucket vector.
[0247] This coding enables the conversion of check-in sequences c=(s,τ) of different lengths into standardized check-in vectors of the same length. The check-in vector is the actual input of the subsequent diffusion module.
[0248] L: The total number of POIs (Points of Interest) in the dataset.
[0249] Superscript s means: s represents the spatial dimension, so is the spatial frequency vector.
[0250] Superscript τ means: τ represents the time dimension, so is the time bucket vector.
[0251] Step 3: Establishing a spatio-temporal diffusion model, including the following steps:
[0252] The model consists of a spatial diffusion module and a temporal diffusion module. Each module uses an independent denoising network: a spatial U-shaped network and a temporal U-shaped network. The U-shaped network will be described in the fourth step. The outputs of the two diffusion modules are mutually conditioned as input in their mutual forward diffusion process and backward reconstruction process.
[0253] The forward diffusion process of the spatial and temporal diffusion module is defined as follows:
[0254]
[0255] where superscripts s and τ represent the spatial component and the temporal component of the original real data respectively, both of which are abstracted as the original real data denoted by x0 for simplicity of description.
[0256] The related parameters of the above formula are described as follows:
[0257] denotes the probability distribution of the spatial component under the condition of time τ.
[0258] denotes the probability distribution of the temporal component under the condition of time τ.
[0259] and denote the initial state of the spatial component and the temporal component respectively.
[0260] and denote the spatial component and the temporal component in the t-th diffusion process respectively.
[0261] denotes a normal distribution, and I denotes an identity matrix.
[0262] α t denotes the proportion of the original signal retained in the t-th diffusion process.
[0263] denotes the continuous multiplication from the first α1 to the t-th α t .
[0264] Suppose that the data x0 is subject to a real distribution P(x0), and x1, x2…x E denote the data obtained by adding noise to x0 in different diffusion steps [1, T], and the noise adding process can be described as:
[0265]
[0266] where t ∈ [1, T], and α t ∈ (0, 1) for different t are predefined and gradually linearly increase from 1 to T, satisfying α1 < α2 < … < α E .
[0267] After reparameterization, the noise adding process is represented by the distribution as:
[0268]
[0269] p(x t |x t-1 ) indicates that in x t-1 under the condition of x t The true distribution (conditional probability).
[0270] Through mathematical derivation, it can be found that:
[0271]
[0272] That is, for the noise addition process, only one calculation is needed to know x after noise addition at any step t. t .
[0273] For the reverse reconstruction process, it is impossible to directly obtain p(x) t-1 |x P However, since the reconstruction process is a Markov process, we can use Bayes' theorem to know that:
[0274]
[0275] p(x t-1 |x t (x0) represents the condition that x0 is known, and x... t under the condition of x t-1 The true distribution (conditional probability). And through p(x) t From |x0), we can know that,
[0276]
[0277] Therefore p(x) t-1 |x t This can be represented as:
[0278]
[0279] because x E It's pure Gaussian noise, from x E Conditional denoising is gradually added to generate x0. However, the true ε(x) is not generated during the generation stage. t Since ε is unknown, cannot be derived or calculated, a neural network needs to be trained. θ (x t The denoising mechanism is denoised using a neural network (ODT), where θ represents the parameters of the neural network. ODT is explained as follows: O represents the starting region of the sample, D represents the destination region, and T represents the starting time. It is used to fit the true ε(x) of the sample during the diffusion process. t This process, using t), gradually reduces noise in the data. That is:
[0280]
[0281] Indicates variance.
[0282] The explanation of ODT is as follows: O represents the origin region of the sample, D represents the destination region, and T represents the departure time.
[0283] Specifically, in the method of this invention, the sampled noise is converted into a meaningful spatial frequency vector through spatial and temporal diffusion modules. and time bucket vector The prior distributions of spatial and temporal noise are defined as follows:
[0284]
[0285] in In order to (or ) Noise reduction to (or The spatial diffusion module (or temporal diffusion module) in the reverse process uses... (or () as a condition to capture spatial-temporal correlation.
[0286] Formally, the reverse process of the spatial and temporal diffusion modules is defined as follows:
[0287]
[0288] The probability of the reverse transition at each step is defined as follows:
[0289]
[0290] θ p This represents the spatial parameters of the diffusion model.
[0291] θ m This represents the time-varying parameters of the diffusion model.
[0292] and This represents the mean term, indicating the mean of the spatial dimension. Depends on the current space state and time status and the mean over time Depends on the current time state and spatial state
[0293] Spatial and temporal denoising networks in and The Chinese character is represented as and
[0294] In this way, two diffusion modules jointly generate a check-in vector Two relevant parts of
[0295] respectively refer to the spatial part and the temporal part corresponding to the check-in vector.
[0296] Further, Figure 1 shows the overall workflow of the proposed diffusion model.
[0297] Step 4 introduces a conditional U-shaped network in the diffusion module, including the following steps: introducing a conditional U-shaped network in the diffusion module.
[0298] Existing denoising networks for sequence generation lack the ability to capture complex spatial-temporal correlations in check-in sequences.
[0299] To make up for this gap, a denoising network called conditional U-shaped network is proposed. As Figure 3 shown, the conditional U-shaped network adopts a U-shaped network-like architecture, consisting of 2Z+1 spatio-temporal perception blocks, where Z is a hyperparameter, and Z=2 is set. Each spatio-temporal perception block adopts a self-attention mechanism to effectively capture the dependence of space and time.
[0300] Further, the fourth step is as follows:
[0301] f), as Figure 3 shown on the left, the i-th block of the conditional U-shaped network takes I (i) as input, C (i) as conditional information, and considers the diffusion step t. In the t-th step of the reverse process, that is, the step of denoising (or ) to (or ), I (0) is (or ), and C (i) is (or ). The output size of the i-th block and the (2Z+2-i)th block is the same.
[0302] As Figure 2 shown, the two blocks are connected together through a residual connection, where is the connection operation. Linear layers are used to perform up / down sampling operations to change the output size. The conditional information of the i+1th block C (i+1) is defined as follows:
[0303]
[0304] g) Next, the diffusion step embedding e t ∈R D
[0305]
[0306] where e t is the embedding vector in the equation initialization diffusion step, d = [1, ···, D / 2], t ∈ [1, T], D is the dimension of the input I (i) in the i-th diffusion module.
[0307] h) Then, I (i) , C (i) are passed through a spatio-temporal perception block to obtain I (i+1) . The self-attention operation in the spatio-temporal perception block involves utilizing queries (Q), keys (K) and values (V). Specifically, Q represents the query matrix, K represents the key value matrix, and V represents the value matrix. The embedding and in the i-th block are adopted and linear projection is applied to convert Q (i) , K (i) , V (i) into three matrices, where represents the linear projection calculation for the query matrix, the key value matrix and the value matrix in the i-th block, respectively, Q (i) , K (i) , V (i) represent the corresponding query matrix, key value matrix and value matrix in the i-th block, respectively. The embedding and in the i-th block are adopted and linear projection is applied to convert Q (i) , K (i) , V (i) into three matrices:
[0308]
[0309] where the scaled dot-product attention and the output H (i) of the i-th block are defined as follows:
[0310]
[0311] H (i) = Attention(Q (i) , K (i) , V (i) 8, Attention represents the attention mechanism
[0312] i) Then, the attention output H (i) is converted to I (i+1) :
[0313]
[0314] j) Finally, the output H (2Z) of the last block is fed into a fully connected layer to obtain the predicted noise.
[0315] Step 5 uses a contrastive learning strategy, including the following steps: further capturing the spatio-temporal correlation of the check-in sequence by using a contrastive learning strategy.
[0316] In order to further bind the space-time diffusion module together and capture the spatio-temporal correlation of the check-in sequence, a contrastive learning of triadic loss is adopted. This loss function aims to make the positive sample closer to the anchor sample. It can be expressed as:
[0317]
[0318] Where A is the anchor sample, P is the positive sample, N is the negative sample, d is the cross entropy, m is the interval between positive and negative samples, S is the number of samples, and max represents the function of taking the maximum value in the sequence.
[0319] Where A i is the i-th anchor sample, P i is the i-th positive sample, and N i is the i-th negative sample. d(A i , P i ) represents the cross entropy of the i-th anchor sample and the positive sample, and d(A i , N i ) represents the cross entropy of the i-th anchor sample and the negative sample.
[0320] Figure 4 The overall process of contrastive learning using anchor samples, positive samples and negative samples is described. Contrastive learning is applied to the space and time diffusion modules respectively. In order to maintain simplicity and clarity, the space diffusion module is mainly used to explain the contrastive learning process. The contrastive learning process of the time diffusion module also follows the same method. In the method of the present application, a real sample is used as the anchor sample, and a sample generated under the condition is used as the positive sample. In order to obtain the negative sample, a negative condition is used to generate
[0321] Generating samples in the diffusion module is computationally intensive and can cause significant delay in training time. At each training iteration, generating positive and negative samples for contrastive learning through t steps further exacerbates this problem. To alleviate the computational burden, a strategy is adopted to estimate the positive and negative samples. Specifically, the spatial diffusion module is utilized to predict and whose equations are shown as follows:
[0322]
[0323] where and denote the positive and negative samples in the spatial dimension during the diffusion process, respectively.
[0324] Similarly, for the temporal diffusion module, a similar strategy can be directly used to estimate and Once the positive and negative samples are generated, the contrastive learning loss is calculated using the formula.
[0325] It is important to note that the negative condition and is crucial in generating negative samples. Among them and denote the negative condition in the temporal dimension and the negative condition in the spatial dimension, respectively. By adopting the method shown in Figure 4 , the negative conditions are generated by randomly rearranging the set of spatial frequency and temporal bucket vectors to ensure they do not match. For example, given from the spatial diffusion module, its negative condition is obtained from a randomly selected different temporal bucket vector. Similarly, for in the temporal diffusion module, its negative condition is also generated in the same way.
[0326] Embodiment 2: As Figure 1 , Figure 2 , Figure 3 , Figure 4 , Figure 5a , Figure 5b , Figure 5c , Figure 5d , Figure 6a , Figure 6b , Figure 6c , Figure 6d , Figure 7a , Figure 7b , Figure 7c and Figure 7dAs shown, a point of interest check-in sequence generation method based on a diffusion model, taking the Canberra wireless network usage dataset as an example, the goal of the model is to generate a point of interest check-in sequence, and the specific implementation process of the technology is as follows.
[0327] Step 1: data preprocessing.
[0328] The detailed preprocessing process is shown in Section 5. The original dataset is cleaned to remove records containing outliers, and smoothing is performed to merge adjacent check-in data with the same AP. Finally, users with high-quality check-in sequences are selected as the training dataset.
[0329] Step 2: data encoding.
[0330] The original check-in sequence c of length M is split into spatial sequence s = <s1, s2, …, s m ,…,s M > and time sequence τ = <τ1, τ2, …, τ m ,…,τ M >. Then, the spatial sequence s and the time sequence τ are encoded into spatial frequency vectors and time bucket vectors of equal length, as shown in Figure 2 .
[0331] Step 3: divide the dataset.
[0332] Data normalization and division of training and test sets. The normalization method based on minimum-maximum scaling is used to map the data to the specified interval -1 to 1, eliminating the scale difference between features. Then 80% of the samples are divided into the training set, and 20% are divided into the test set.
[0333] Step 4: train the model using the samples obtained in Step 2.
[0334] First, initialize the parameters θ s and θ m of the spatial and temporal conditional U-shaped network. Then sample t from a uniform distribution and use the formula to train the two diffusion modules.
[0335] Subsequently, generate negative conditions for contrastive learning, then generate positive and negative samples, and calculate the contrastive learning loss using the formula.
[0336] Finally, integrate the contrastive learning loss with the diffusion loss, and update the parameters θ s and θ m accordingly. λ is the weight of the contrastive loss.
[0337] The sixth step algorithm is shown in the following table:
[0338] Algorithm 1: Training procedure
[0339] 1. Initialize spatial CUnet network parameters θ s and temporal CUnet network parameters θ τ .
[0340] 2. Repeat the following steps until convergence:
[0341] a. Sample spatial frequency vector from probability distribution and sample temporal bucket vector from probability distribution
[0342] b. Sample noise ∈ from standard Gaussian distribution and sample diffusion step t from uniform distribution
[0343] Uniform({1,...,T}).
[0344] c. Compute spatial diffusion loss and temporal diffusion loss.
[0345] d. Construct temporal negative condition and spatial negative condition.
[0346] e. Generate temporal positive-negative samples and spatial positive-negative samples.
[0347] f. Compute spatial contrastive loss and temporal contrastive loss.
[0348] g. Update spatial diffusion module loss and temporal diffusion module loss.
[0349] At test time, compute JSD-all, JSD-t, JSD-r, JSD-u evaluation metrics to evaluate the trained model and select the optimal model.
[0350] Step 5: Generate check-in sequences using the optimized model.
[0351] According to the trained model of the last step, the interest point check-in sequence can be generated.
[0352] Algorithm 2 provides a detailed description of the sampling process.
[0353] First, sample and from Gaussian distributions. and Then, convert these samples to and over T steps. At each step,
[0354] It is found that using asymmetric time intervals in the sampling process of generating the check-in vector can improve the sampling quality of the model, which is expressed as Here, ξ represents a small non-negative time interval parameter. It should be noted that the training stage remains unchanged and does not use time intervals.
[0355] Finally, the output check-in vector x0 is post-processed by denormalization integer rounding. Then, the time bucket recovery method introduced in the second step is used to recover the time bucket of the i-th POI, where the arrival time of the i-th POI is equal to Then, all the time buckets are expanded in the order of the index number of the time slot to obtain the final generated check-in sequence.
[0356] The seventh step algorithm is as follows:
[0357] Sampling process:
[0358] 1. Randomly select a sample from the set of all possible spatial frequency vectors and time bucket vectors as the initial sample, denoted as and
[0359] 2. From the last time step, generate the sample of each time step step by step until the first time step is reached.
[0360] a. For each time step, if it is the first time step, set the noise z to a zero vector; otherwise, sample a noise vector z from a standard Gaussian distribution.
[0361] b. Using the diffusion model and the denoising network, combine the current time step sample and the noise vector to generate the sample of the previous time step and
[0362] 3. Return the generated first time step sample and
[0363] As shown in Figure 1 , a space-time conditional diffusion model is proposed for generating check-in sequences, which is divided into five parts from left to right:
[0364] 1) First, a space-time lossless coding method is used to match the check-in sequence as the appropriate input of the model, which converts check-in sequences of different lengths into equal length check-in vectors.
[0365] 2) The entire model consists of a spatial diffusion module with independent denoising networks and a temporal diffusion module. The denoising network is optimized through the forward diffusion and backward reconstruction process during training, and the sequence is generated through the denoising network during sampling.
[0366] 3) In the reconstruction process, contrastive learning is adopted to capture the correlation between the spatial and temporal aspects of the check-in sequence.
[0367] As Figure 2 shown, a check-in sequence c = <(s0, τ0), (s1, τ1), …, (s 10 ,τ 10 )> is generated from the Canberra dataset. By calculating the visit frequency of each POI in c, it is known that he visited the 1st POI once, the 2nd POI three times, the 314th POI five times, and the 315th POI twice. In addition, -1 is used to represent that the corresponding POI is not visited. The user visited the 2nd POI three times in the 10th, 12th, and 22nd time slots, so L2 = [10, 12, 22]. Then, a new numerical processing method is adopted, which can convert each time bucket list l i into a positive integer and restore the original L i without losing information.
[0368] As Figure 3 shown, the conditional U-shaped network adopts a similar U-shaped network architecture, which is composed of 2Z+1 spatio-temporal perception blocks, where Z = 2 is set. Each spatio-temporal perception block adopts a self-attention mechanism to effectively capture the spatial and temporal dependencies. As Figure 3 shown on the left side, the i-th block of the conditional U-shaped network takes I (i) as input, C (i) as conditional information, and considers the diffusion step t. In the t-th step of the reverse process, i.e., the step of denoising (or ) to (or ), I (0) is (or ), and C (i) is (or ). The output size of the i-th block and the (2Z+2-i)th block is the same.
[0369] As Figure 2 shown, the two blocks are connected together through a residual connection, where is the connection operation. Linear layers are used to perform up / down sampling operations to change the output size. The conditional information of the i+1th block C (i+1) is defined as follows:
[0370]
[0371] As Figure 4The diagram illustrates the overall process of contrastive learning using anchored samples, positive samples, and negative samples. Contrastive learning is applied to both spatial and temporal diffusion modules. To maintain simplicity and clarity, the spatial diffusion module is primarily used to explain the contrastive learning process. The contrastive learning process in the temporal diffusion module follows the same approach. In this method, a real sample is used... As anchor samples, and under the condition of Samples generated under the circumstances As positive samples. To obtain negative samples, use negative conditions. generate
[0372] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for generating point-of-interest check-in sequences based on a diffusion model, characterized in that, Includes the following steps: Step 1: Data preprocessing. Clean and smooth the real-world dataset to ensure data quality and consistency. Step 2: Perform spatiotemporal lossless encoding to convert check-in sequences of different lengths into check-in vectors of equal length. Encode the vectors using spatial frequency vectors and time bucket vectors to preserve the information of the original sequence. Step 3: Establish a diffusion model, construct a spatial diffusion module and a temporal diffusion module, and capture spatiotemporal features using the forward diffusion process and the backward reconstruction process; Step 4: Introduce a conditional U-shaped network into the diffusion module and propose a denoising network to capture complex spatiotemporal correlations, which are modeled through a self-attention mechanism; Step 5: Use a contrastive learning strategy, employing ternary contrastive learning to further capture the spatiotemporal correlation of the check-in sequence and strengthen the connection between the temporal and spatial diffusion modules; Step 4, introducing a conditional U-shaped network into the diffusion module, includes the following steps: introducing a conditional U-shaped network into the diffusion module. The Conditional U-shaped network adopts a U-shaped network-like architecture, consisting of 2Z+1 spatiotemporal awareness blocks, where Z is a hyperparameter set to Z=2. Each spatiotemporal awareness block employs a self-attention mechanism to effectively capture spatial and temporal dependencies. Furthermore, a) In the i-th block of the conditional U-shaped network, I (i) For the input of the i-th block, C (i) Given the conditional information for the i-th block, and considering diffusion step t, in the t-th step of the reverse process, Soon Denoising In the steps, I (0) yes And C (i) yes Denoising In the steps, I (0) yes And C (i) yes The output size of the i-th block and the (2Z+2-i)-th block are the same. The two blocks are connected together by a residual, where It's a connection operation that uses a linear layer to perform upsampling / downsampling operations to change the output size, in the (i+1)th block C. (i+1) The condition information is defined as follows: C (i+1) This represents the condition information for the (i+1)th block. b) Next, initialize the diffusion step embedding e using the following equation. t ∈R D Where e t Initialize the embedding vector in the diffusion step of the equation, d = [1, ..., D / 2], t ∈ [1, T], where D is the input I in the i-th diffusion module. (i) Dimensions c) Then, I (i) C (i) I is obtained through spatiotemporal sensing blocks. (i+1) The self-attention operation in the spatiotemporal awareness block involves utilizing a query Q, a key K, and a value V. Specifically, Q represents the query matrix, K represents the key-value matrix, and V represents the value matrix, employing the embedding from the i-th block. and And apply linear projection Q (i) K (i) , V (i) Converted into three matrices, where Q represents the linear projection calculation of the query matrix, key matrix, and value matrix in the i-th block, respectively. (i) K (i) V (i) These represent the query matrix, key matrix, and value matrix corresponding to the i-th block, respectively: Wherein, the scaled dot product attention and the output H of the i-th block are... (i) The definition is as follows: H (i) =Attention(Q) (i) ,K (i) V (i) Attention refers to the attention mechanism. d) Then, use an upsampling / downsampling network to apply the attention output H (i) Convert to I (i+1) : e) Finally, output H of the last block (2Z) A fully connected layer is fed in to obtain the predicted noise.
2. The method for generating point-of-interest check-in sequences based on a diffusion model according to claim 1, characterized in that, Step 1, data preprocessing, includes the following steps: Preprocessing the acquired real-world datasets, which contain user access sequences to various Points of Interest (POIs), comprehensively reflecting user behavior in different environments. Multiple preprocessing operations are performed on the original check-in sequences of each dataset. First, data cleaning is performed by eliminating outliers and deleting check-in points with missing values or connection bandwidth below 1kbps. Next, data smoothing is applied by treating consecutive records with connection duration differences of less than 1 hour as the same POI, as long as they only switch between two points of interest. Finally, adjacent records with the same point of interest and a small time interval are merged.
3. The method for generating point-of-interest check-in sequences based on a diffusion model according to claim 1, characterized in that, Step 2 involves spatiotemporal lossless encoding, including the following steps: obtaining a check-in vector of equal length. First, the original sign-in sequence c of length M is split into a spatial sequence s = <s1,s2,…,s m ,…,s M > and time series τ=<τ1,τ2,…,τ m ,…,τ M >, The relevant parameters are defined as follows: m: is a non-negative integer s1: The index number of the first POI (Point of Interest). s S : The index number of the m-th POI (Point of Interest). s T The index number of the Mth POI (Point of Interest). τ1: Index number of the first arrival time slot. τ S : The index number of the m-th arrival time slot τ T : The index number of the Mth arrival time slot Interest Point Check-in Sequence c: The interest point check-in sequence c is defined as a sequence containing check-in points c = <(s1,τ1),(s2,τ2),…,(s S ,τ S ),…,(s T ,τ T c is the sequence of check-in points. Where M is the length of the check-in sequence, and L is the number of POIs in the entire POI set. Then, the spatial sequence s and the time series τ are encoded into spatial frequency vectors of equal length. and time bucket vector in, This represents the initial state of the spatial components of the diffusion model. This represents the initial state of the time component of the diffusion model. These vectors are decoded into the original sequence without losing information. This indicates that an equivalent conversion is performed between the sign-in sequence and the sign-in vector. Specifically, spatial frequency vector It is obtained by calculating the access frequency of each POI in the sequence. Its i-th element is defined as: Where i = 0, 1, ..., L in This refers to the number of times the i-th POI in the spatial frequency vector is visited, where L is the total number of POIs, and M is the length of this check-in sequence. # Let s represent the i-th POI. S It is the index number of the m-th POI (Point of Interest), and F is an indicator function. If s S equals i # If the result is positive, then F = 1; otherwise, F = 0. A check-in sequence c = <(s1,τ1),(s2,τ2),…,(s...) generated from the Canberra dataset. 10 ,τ 10 )>, s1: The index number of the first POI (Point of Interest). s 10 The index number of the 10th POI (Point of Interest). τ1: Index number of the first arrival time slot. τ 10 The index number of the 10th arrival time slot. By calculating the access frequency of each POI in c, we know that the first POI was accessed once, the second POI was accessed three times, the 314th POI was accessed five times, and the 315th POI was accessed twice. In addition, -1 is used to indicate that the corresponding POI has not been visited. Next, we will introduce time bucket vectors. First, a corresponding time list is built for each POI. To record the time slot for accessing this POI: τ ] : The index number of the j-th time slot j: Index of the sequence of interest points s ] : The index number of the POI (Point of Interest) of the j-th point of interest. i # : indicates the i-th POI, This represents a list of times constructed for each POI. This represents the list of times constructed for the i-th POI. Then, a numerical processing method is used to list each time bucket. Convert to positive integer And restore the original without losing information. in The i-th element in the time bucket vector refers to the positive integer resulting from the encoding of the arrival time of the i-th POI. This refers to the number of times the i-th point of interest (POI) is visited in the spatial frequency vector. Time bucket conversion: Specifically, firstly, ... The index number of each time slot in the array is converted to binary form, and these binary numbers are padded with zeros on the left to form a binary number. Number of digits, Here, ceil(·) represents the round-up operation. Indicates a base-2 pair The logarithm is calculated, and finally, these binary numbers are concatenated into a single aggregate binary number. Then, a binary conversion method is used to convert the aggregate binary number into positive decimal. i: represents the index number of the i-th POI. τ: The superscript τ indicates the time dimension. In addition, -1 is used to represent The corresponding POI was not visited. Time Bucket Restoration: On the other hand, restore positive integers to the original time bucket list L. i The following steps are involved: Convert the positive decimal to binary. If the number of bits in the binary representation is less than v·ceil(log2(T)), pad it with zeros on the left. Here, υ is the number of bits reaching i. # The number of times, i # For the i-th point of interest, the binary data is divided into v segments. Each segment is converted from binary format to a decimal time slot index. Finally, the indexes of all time slots are combined to form the original time bucket list. By implementing spatiotemporal lossless coding, the actual inputs to the spatial diffusion and temporal diffusion modules, namely the spatial frequency vector, were obtained. and time bucket vector The first element in the spatial frequency vector. The Lth element in the spatial frequency vector. The first element in the time bucket vector. The Lth element in the time bucket vector. This encoding enables the conversion of check-in sequences c = (s, τ) of different lengths into standardized check-in vectors of the same length. The sign-in vector is the actual input to the subsequent diffusion module, where L represents the total number of points of interest (POIs) in the dataset. The superscript 's' indicates that 's' represents the spatial dimension. It is a spatial frequency vector, with the superscript τ indicating that τ represents the time dimension. It is a time bucket vector.
4. The method for generating point-of-interest check-in sequences based on a diffusion model according to claim 1, characterized in that, Step 3, establishing the spatiotemporal diffusion model, includes the following steps: The model consists of a spatial diffusion module and a temporal diffusion module. Each module uses an independent denoising network: a spatial U-shaped network and a temporal U-shaped network. The outputs of these two diffusion modules serve as conditional inputs to each other during their interconnected forward diffusion and backward reconstruction processes. The forward diffusion process of the spatial and temporal diffusion modules is defined as follows: Here, the superscripts s and τ represent the spatial and temporal components of the original real data, respectively. For simplicity, both are abstracted as the original real data represented by x0. The relevant parameters of the above formula are explained as follows: This represents the spatial components under the condition of time τ. The probability distribution, This represents the time component under the condition of time τ. The probability distribution, and These represent the initial states of the spatial and temporal components, respectively. and Let these represent the spatial and temporal components of the diffusion process at step t, respectively. Let I represent the normal distribution, and let I represent the identity matrix. α t This represents the proportion of the original signal retained during the t-th diffusion step. This represents the sequence from the first α1 to the tth α. t The product of two products, Suppose that the data x0 follows the true distribution P(x0), x1, x2, ..., x... + This represents the data after adding noise to x0 through different diffusion steps in the range [1,T], where T is the total number of diffusion steps. The noise addition process can be described as follows: in t∈[1,T], α for different t t ∈(0,1) is predefined and linearly increases gradually from diffusion steps 1 to T, satisfying α1<α2<…<α + , After reparameterization, the noise addition process can be represented by a distribution as follows: p(x t |x t-1 ) indicates that in x t-1 under the condition of x t The true distribution of conditional probability, derived mathematically, is... That is, for the noise addition process, only one step is needed to calculate x after noise addition at any step t. t , For the reverse reconstruction process, it is impossible to directly obtain p(x) t-1 |x { However, since the reconstruction process is a Markov process, we know using Bayes' theorem that: p(x t-1 |x t (x0) represents the condition that x0 is known, and x... t under the condition of x t-1 The true distribution of x, i.e., conditional probability, and through p(x) t From |x0), we can know that, μ(x t Let ,t) represent the estimation function of x0 at step t in the diffusion process. At the same time p(x t-1 |x t ) is represented as: because x + It's pure Gaussian noise, from x + Gradually add conditional denoising to generate x0, ε(x) t ,t) represents the true Gaussian noise at step t, but the true ε(x) during the generation stage. t Since ε is unknown, cannot be derived or calculated, a neural network needs to be trained. … (x t The denoising mechanism is denoised using a neural network (ODT), where θ represents the parameters of the neural network. ODT is explained as follows: O represents the starting region of the sample, D represents the destination region, and T represents the starting time. It is used to fit the true ε(x) of the sample during the diffusion process. t ,t), that is, the true Gaussian noise at step t, thus completing the stepwise denoising of the noisy data, i.e.: Represents variance. The explanation of ODT is as follows: O represents the departure region of the sample, D represents the destination region, and T represents the departure time. The sampled noise is converted into a meaningful spatial frequency vector using spatial and temporal diffusion modules. and time bucket vector The prior distributions of spatial and temporal noise are defined as follows: in In order to Denoising The spatial diffusion module in the reverse process uses As a condition, to capture space-time correlations Formally, the reverse process of the spatial and temporal diffusion modules is defined as follows: The probability of the reverse transition at each step is defined as follows: The relevant parameters are defined as follows: θ s This represents the spatial parameters of the diffusion model. θ · This represents the time-varying parameters of the diffusion model. and This represents the mean term, indicating the mean of the spatial dimension. Depends on the current space state and time status and the mean over time Depends on the current time state and spatial state Spatial and temporal denoising networks in and The Chinese character is represented as and In this way, the two diffusion modules jointly generate a check-in vector. Two related parts Refer to the sign-in vector respectively The corresponding spatial and temporal components.
5. The method for generating point-of-interest check-in sequences based on a diffusion model according to claim 1, characterized in that, Step 5 employs a contrastive learning strategy, including the following steps: A contrastive learning strategy is used to further capture the spatiotemporal correlation of the check-in sequence. A ternary loss-based contrastive learning approach is used, where the loss function aims to bring positive samples closer to the anchor samples, expressed as: Where A is the anchor sample, P is the positive sample, N is the negative sample, d is the cross-entropy, m is the interval between positive and negative samples, S is the number of samples, and max represents the function that takes the maximum value in the sequence. Among them, A i It is the i-th anchored sample, P i It is the i-th positive sample, N i It is the i-th negative sample, d(A) i ,P i ) represents the cross-entropy between the i-th anchor sample and the positive sample, d(A i N i ) represents the cross-entropy between the i-th anchor sample and the negative sample. The overall process of contrastive learning using anchored samples, positive samples, and negative samples is explained by applying contrastive learning to the spatial and temporal diffusion modules respectively. For simplicity and clarity, the spatial diffusion module is used to explain the contrastive learning process, where a real sample... As anchor samples, and under the condition of Samples generated under the circumstances As positive samples, negative conditions are used to obtain negative samples. generate The strategies for estimating positive and negative samples include using spatial diffusion modules for prediction. and Spatial components representing the initial state, The time component representing the initial state is represented by the following equation: in, and These represent positive and negative samples in the spatial dimension during the diffusion process, respectively. Similarly, for the time-diffusion module, a similar strategy is used directly for estimation. and Once positive and negative samples are generated, the contrastive learning loss is calculated using the formula. Negative conditions and It is the key to generating negative samples, among which and Let these represent negative conditions in the time dimension and negative conditions in the spatial dimension, respectively. Negative conditions are generated by randomly rearranging the spatial frequency and time bucket vector sets to ensure they do not match, given from the spatial diffusion module. Its negative condition It is obtained from randomly selected time bucket vectors, for the time spread module. Its negative condition It is generated using the same method.
Citation Information
Patent Citations
A method for generating vehicle trajectories
CN110223515B
Method and system for automatically generating people movement track and foothold
CN111985452A
Next POI recommendation method based on user preference and spatio-temporal context information
CN117194763A
Virtual fitting image restoration method based on diffusion condition generation algorithm
CN116703747A
Next interest point recommendation method based on double-contrast learning
CN118364176A