User Re-Identification via Confusion of the Contrastive Distillation Network and Attention Mechanism

With the rise of social networks, more and more users share their location on social networks. This gives us a new perspective on the study of user movement patterns. In this paper, we solve the trajectory re-identification task by identifying human movement patterns and then linking unknown trajectories to the user who generated them. Existing solutions generally focus on the location point and the location point information, or a single trajectory, and few studies pay attention to the information between the trajectory and the trajectory. For this reason, in this paper, we propose a new model based on a contrastive distillation network, which uses a contrastive distillation model and attention mechanisms to capture latent semantic information for trajectory sequences and focuses on common key information between pairs of trajectories. Combined with the trajectory library composed of historical trajectories, it not only reduces the number of candidate trajectories but also improves the accuracy of trajectory re-identification. Our extensive experiments on three real-world location-based social network (LBSN) datasets show that our method outperforms existing methods.


Introduction
With the popularization of mobile devices and the development of mobile computing technology, the amount of spatio-temporal trajectory data has shown explosive growth. Spatio-temporal trajectory data record the behavior trajectory of individuals in space and time, such as GPS positioning data of mobile devices, check-in data on social networks, data for card payments in public transportation systems, etc. Analyzing these data will help us to dig into human movement patterns and behavior patterns, predict and model human behavior, and develop intelligent business models to improve user experience. It can also provide effective solutions for urban intelligent transportation [1,2], personalized interest point recommendation [3][4][5], friend recommendation, character relationship extraction [6], location prediction [7,8], criminal detection [9][10][11], public safety [12], and other issues.
The user re-identification task is basic in the analysis of human movement behavior. It links unknown trajectories to the corresponding user to achieve the purpose of reidentification. User re-identification can be applied to many fields of trajectory data mining. For example, applications such as shared bicycles collect a large amount of user behavior trajectory information in the background, but this user ID information is hidden. Social networks such as Gowalla, Weeplaces, Foursquare, and Facebook Places [13] collect detailed information such as restaurants, shopping centers, and hotels that are visited by users. When users access an application, they generate mobile data in the background. When the accumulated trajectory data are sufficient, these mobile data can be connected to form a complete mobile trajectory sequence. Through these complete mobile trajectory sequences, more human mobile mode information can be tapped. Commonly used human trajectory modeling methods such as the Markov chain (MC) [14] and recurrent neural network (RNN) are based on historical check-ins modeling human liquidity.
Solving the problem of user re-identification can involve adopting general classification methods, such as longest common subsequence (LCSS), edit distance on real sequence (EDR), dynamic time warping (DTW), and other methods based on trajectory similarity. Another possibility is creating a solution based on a deep neural network model. Ref. [15] first used deep learning models to deal with trajectory-user link problems. The embedding method is used to embed the user-generated position into the vector space, and the recurrent neural network model is used to model the trajectory information. Because RNN can input a variable-length trajectory sequence and capture the long-term dependence of the position, the result achieves good performance. The TULVAE [16] model improves on the former model by learning high-level semantic information regarding trajectories and using semisupervised learning to improve linking capabilities. Following this, ref. [17] proposed an end-to-end attentional circulation neural learning framework (TULAR). Despite the effectiveness of the current methods, they struggle to make accurate predictions at a high level, for the following reasons: (1) check-in data are sparse. User check-in data generally do not have a fixed frequency and rules, which can lead to noise or abnormal values. These problems have presented huge challenges to re-identification tasks. (2) The existing models struggle to distinguish between similar embedding vectors and cannot capture the dependency of the trajectory sequences. (3) Most models lack effective use of historical trajectories. Establishing how to effectively use historical trajectory information is also a major challenge.
To solve the above challenges, we propose a model of a contrastive distillation network. In this model, we use the Word2vec [18] method for sparse social network datasets to convert the trajectory data into the form of word vectors, each of which corresponds to the characteristics of a location point. To better distinguish between similar vectors and capture trajectory dependencies, we propose a network model based on a contrastive framework, using RNN and Transformer models to learn the differences between trajectory pairs, and adding a global attention mechanism to learn the correlation of trajectories. For the use of historical trajectories, we establish a user-to-location mapping relationship, called the trajectory-user library. When given an unknown trajectory, we go to the trajectory-user library to query the corresponding candidate user, and then send the unknown trajectory and the corresponding candidate user's trajectory pair into our model to calculate the similarity score. Finally, we use a statistical-based method to determine user IDs with unknown trajectories. The main contributions of this work are as follows:

•
We propose a contrastive distillation network model to solve the problem of user re-identification. This model combines the advantages of the distillation model and the contrastive learning framework. To the best of our knowledge, our model is the first model to combine the user-trajectory library with the contrastive distillation network, which greatly improves the versatility and rationality of the task.

•
We design a supervised contrastive learning framework based on an RNN trajectory encoder and Transformer trajectory encoder to learn the latent semantic features of trajectory sequences, combined with the attention mechanism, focusing on learning the common key information between trajectory pairs. • We conduct extensive experiments on three real public datasets. Experimental results verify the effectiveness of the model and outperform the existing methods.
The rest of this article is structured as follows. In Section 2, we introduce the work related to the re-identification tasks of trajectory. After that, a statement of a short trajectory re-identification is given in Section 3. Section 4 describes the details and frameworks of the entire network of our model. Section 5 introduces the evaluation methods and experimental results, and the paper is summarized in Section 6.

Related Work
With the popularity of social networking software and the advancement of location acquisition technology, trajectory data mining is becoming an increasingly important research topic. These trajectory data represent the mobility of human behavior, providing unprecedented information for understanding patterns of human behavior and contributing to the widespread use of location-based social networks [19], intelligent transportation systems, and urban computing [20]. Aiming at the trajectory data, the problems of trajectory pattern mining, trajectory uncertainty, outlier detection, trajectory classification, and personalized interest recommendation are proposed. User re-identification is also an important task in trajectory data mining, and its main task is to associate the trajectory with the user who generated the trajectory. Research on social network-based user mobility is becoming the focus of research.
The common ways to solve trajectory classification is to use probability graph models, such as dynamic Bayesian networks (DBN), hidden Markov model (HMM), and conditional random fields (CRF), but these methods struggle to capture the dependencies and spatiotemporal characteristics between trajectory sequences. It can also be solved using classification methods commonly used in machine learning, such as SVM [21], KNN [22], and random forest [23]. In recent years, researchers have begun to use deep learning methods to study the problem of trajectory re-identification. Ref. [15] first adopted deep learning methods to solve the problem of user trajectory linking. In subsequent research, ref. [16] used variational autoencoders to improve the TULER model and proposed the TULVAE model framework. Ref. [24] proposed the AdattTUL model to dynamically capture the complex relationship of user check-in from trajectory data. Ref. [25] proposed the DeepTUL model, which not only combines multiple characteristics of user mobility to model high-order complex movement patterns but also learns from historical trajectories to capture the multi-periodicity of user mobility and alleviate the problem of data sparsity. Ref. [17] proposed an end-to-end attentional neural learning framework (TULAR). Ref. [26] proposed a new mutual distillation learning network (MainTUL) to solve the TUL problem of sparse check-in mobile data. From the perspective of calculating trajectory similarity, traditional methods include longest common subsequence (LCSS) [27], editing distance on real sequence (EDR) [28], dynamic time warp (DTW) [29], etc., but these research methods focus more on improving the efficiency of trajectory similarity calculation. Based on deep semantic similarity calculation, it is possible to learn the internal relationships of trajectories. In this work, semantic trajectory similarity is calculated based on our contrastive distillation network, and the differences between pairs of trajectories are learned, capturing long-term dependencies between locations. In addition, for the representation of user tracks, we add a global attention mechanism that allows the model to learn the correlation between trajectories.

Problem Definition
Let T u i = {l i1 , l i2 , l i3 , . . . , l in } denote a trajectory generated by the user u i in a period of time, where l ij (j ∈ {1, 2, . . . , n}) is a location at time t j for the user u i . For spatio-temporal trajectory information T u p = l p1 , l p2 , l p3 , . . . , l pn , we know that u p generated it, meaning that this situation is labeled as identified. But, for the trajectory T u q = l q1 , l q2 , l q3 , . . . , l qn , we know the trajectory data but do not know who generated them, meaning that this situation is labeled as unidentified. The re-identification task involves finding the user who generated the trajectory T u q and converting its status to identified.

Trajectory Pre-Processing
To facilitate our modeling, we need to divide the user-generating sequence of longterm trajectories into continuous sub-trajectories (e.g., 6 h, one day, or one week) that follow the lifestyle of human behavior. The purpose is to study the characteristics of human space-time motion and provide richer knowledge for semantic trajectory analysis such as trajectory data mining. The social network dataset we choose comprises a sequence of sample points containing information such as latitude and longitude, time points, user IDs, etc. Due to the sparseness of the social network dataset, we need to preprocess it to a certain extent. Less frequent check-ins by users mean that those spots are visited by fewer users. This affects the reliability and accuracy of the results. Deleting some less frequent data points can make the data more representative. In this way, the data can better reflect the overall user behavior and geographical distribution, and make the data more generalizable. We adopted the method in [15] to improve the reliability and generalization of our dataset.

Data Construction
Our model is built on a contrastive learning network. Contrastive learning network models are usually composed of two identical or similar networks, and their training data generally exist in the form of a sample pair, so we need to build positive and negative samples to train the model. The input to the model is of the form (trajectory A, trajectory B, label), and if the label is 1, we can establish that trajectory A and trajectory B are from the same user. If the label is 0, we can establish that trajectory A and trajectory B are from different users.

Proposed Method
In this section, we will describe our proposed model of the contrastive distillation network, which is shown in Figure 1. It should be noted here that our contrastive distillation network does not strictly distinguish between teacher and student networks like [30], but learns from scratch. We use the trajectory embedding layer to turn the trajectory pair into the form of a feature vector, and then input the feature vector representation of the trajectory pair into the RNN encoder and Transformer encoder layer for learning, and the output of the RNN encoder and Transformer encoder layer is concatenated using the attention layer to learn the connection of trajectory pairs and obtain the context of the laws of human activity with higher semantics. Finally, we will perform feature fusion by comparing the features learned by the distillation model to obtain better model performance. When identifying an unknown trajectory, we need to calculate the similarity between it and the candidate trajectory in the trajectory user library to complete the re-identification task-see Section 4.5 for details.

Trajectory Embedding Layer
Social network datasets contain information such as latitude and longitude, time, user ID, location number, etc., which are complex and heterogeneous and cannot be directly entered into the model. We use a fixed vector of dimensions to represent each location point, but if we use common one-hot encoding, there is a dimensional curse. This is because there are usually tens of thousands of location points in the dataset so one-hot

Trajectory Embedding Layer
Social network datasets contain information such as latitude and longitude, time, user ID, location number, etc., which are complex and heterogeneous and cannot be directly entered into the model. We use a fixed vector of dimensions to represent each location point, but if we use common one-hot encoding, there is a dimensional curse. This is because there are usually tens of thousands of location points in the dataset so one-hot encoding will have tens of thousands of dimensions, which is obviously not feasible. In addition, the use of fixed-dimensional vectors can alleviate the sparsity of social network data. Specifically, we use Word2vec in natural language processing to learn the embedding expression of each location point, and the calculation formula of the trajectory embedding layer is as follows: where V i , W, and b are the learnable parameters of the trajectory embedding layer, and L i represents the ID of the location point.

Contrastive Distillation Encoder Layer
The contrastive distillation encoding layer is built based on the contrastive learning framework and two different models in the distillation network. In order to make the contrastive distillation encoding layer learn the differences between trajectories, we use two different basic models, RNN and Transformer. RNN is a common model for processing sequence data, and Transformer can process both sequence data and non-sequence data.

RNN Encoder
RNN is an efficient architecture for handling variable-length sequences. Due to the sparsity of check-in trajectories, we used two variants of RNN (long short-term memory network (LSTM) [31] and gate recurrent unit (GRU) [32]) as encoders for f ∅ to process the input trajectories. The architecture of LSTM consists of a memory cell and three gates, namely an input gate i, output gate o, and forget gate f. The specific formula is as follows: where i t , o t , and f t represent the input gate, output gate, and forget gate, respectively. σ represents the activation function. W i , U i , V i , and b i represent learnable parameters of the input gate. W o , U o , V o , and b o represent learnable parameters of the output gate. W f , U f , V f , and b f represent learnable parameters of the forget gate, and x t represents the output vector of the trajectory embedding layer. h t−1 represents the previous moment hidden state, c t represents the current cell state, c t−1 represents the previous moment cell state, and c t is updated by The state h t is then updated by where tanh(·) refers to the hyperbolic tangent function, and is the entry-wise product. W c , U c , and b c represent learnable parameters of the cell state, x t represents the input for the current time step, and h t represents the current hidden state. Similar to LSTM, the GRU model has two gates, namely the update gate and the reset gate: We update the state of h t by a linear interpolation between the last state h t−1 and the state ∼ h t as The update formula of ∼ h t is as follows: where W is the weight matrix of the x t , x t is the input of the current time step, U is the weight matrix of the hidden state of the previous time step, z t represents the update gate, r t represents the reset gate, is the entry-wise product, and h t−1 is the hidden state of the previous time step.

Transformer Encoder
In [33], Google proposed the Transformer model, which uses a self-attention structure to replace the RNN network structure commonly used in NLP tasks [34] and other tasks [35]. Compared with the RNN network structure, its biggest advantage is that it can be computed in parallel. The Transformer model consists of positional embeddings, an attention module, a feed forward network, and a residual regularization module. The traditional convolutional neural networks (CNN) [36] and RNN structure are abandoned in the Transformer, and the entire network structure is composed entirely of the attention mechanism, and the addition of positional embeddings allows the model to learn the sequence of sequences. Based on the attention mechanism, the transformer model can mine the nonlinear feature relationship between trajectory time information and spatial position. In the transformer model, the attention module is composed of a self-attention mechanism and a multi-head attention mechanism.
For the self-attention machine, we need three matrices: matrix Q, matrix K, and matrix V as inputs, where matrix Q and matrix K T are dot products, and then we multiply by 1/ √ d k , perform the softmax function, and finally multiply by the matrix V. The specific formula is as follows: where d k is the dimension of the vector k in the formula, and the reason for multiplying by 1/ √ d k is twofold. Firstly, it is performed to increase the value of QK T moderately. Secondly, it is used to prevent the gradient disappearance in backpropagation caused by excessively large values when the dimension is too large.
Another type of multi-head attention allows the model to collectively focus on information that represents subspaces from different locations. Thus, the potential features of the trajectory sequence can be co-generated by different representation subspaces to improve the performance of the attention layer, as follows: where head i = Attention i QW Q i , KW K i , VW V i , and head i represents the i-th head of the multi-head attention mechanism. W Q , W K , and W V are learnable parameter matrices, and W O is an output fully connected layer that combines n heads.
After global attention, there is a residual connection and regularization module layer to solve the problem of gradient vanishing and the degradation of the weight matrix, as follows: Connecting a fully connected layer after the residual module, the fully connected feedforward network consists of two linear transformations with the ReLU activation function Due to the sparse feature of location-based social network [19] datasets, the RNN network will forget some important location information of the user, and it is difficult to fully mine the user's check-in behavior pattern through time series. The attention mechanism of the Transformer network can focus on the entire trajectory sequence. In our contrastive distillation model, both the Transformer model and RNN model are used. Two encoders with different performances will make our entire model more generalizable and decoupled better.

Global Attention Layer
The main principle of the attention mechanism [37] is to find key information from a large amount of information. In recent years, the combination of RNN and the attention mechanism has been very common, such as TULAR [16] and Deep TUL [25], but these models only focus on the connections between location points. In our paper, in order to enable our comparison framework to find key information from trajectory to trajectory, we also combine the comparison framework and attention mechanism, introducing a global attention mechanism. We set the input of the global attention mechanism as h t = output model (15) h s = output model (16) where output model represents the trajectory average feature representation of the Transformer encoder or RNN encoder's output, and output model represents the trajectory feature representation of the Transformer encoder or RNN encoder's output. model represents the Transformer encoder or RNN encoder. The global attention score is calculated as follows: where h t and h s are Equation (15) and Formula (16), and α t is the score of the attention mechanism, while W and v are learnable weight parameters. It is worth mentioning that to learn common key information between pairs of trajectories, h t and h s in score h t , h s must come from different networks.

Output Layer
We concatenate the feature vectors from the global attention layer and perform feature fusion on positive and negative samples. After two linear layers, the results are quantified using the sigmoid function. If the result is 1, it indicates that the positive and negative samples are from the same user; if the result is 0, it means that the positive and negative samples come from different users.

Unknown Trajectory Information Matching
When entering an unknown trajectory, we first go to the trajectory-user library to look for trajectory candidates. The average number of candidate users can be seen in Table 1. Due to the large number of trajectories of candidate users, we sampled them. The sampling frequency defaults to 15. After sampling, the candidate trajectories of each candidate user are obtained. Then, the similarity between the unknown trajectory and the candidate trajectories is calculated. Finally, the candidate user with the highest similarity is determined as the one who generates the unknown trajectory, and this trajectory re-identification task is completed using a statistics-based method. We know that for a user, their movement trajectory is regular, and different users are unique. We can use the user movement feature to achieve our trajectory re-identification task. We employ the data from the training set to establish the trajectory-user library. Each user is linked to multiple locations, and each location point is associated with multiple users. Consequently, we record all users corresponding to each location point, thereby constituting the comprehensive trajectory-user library.

Results
In this section, we will discuss the performance of our model in real-world datasets. First, we introduce datasets, baseline models, assessment measures, and parameter settings. Then, our model is compared to the baseline model, and the impact of different strategies is analyzed. Finally, we present experimental results and model effect analysis under different constraints.

Experimental Settings
Datasets. We evaluate our approach based on three datasets, including Gowalla, Foursquare (NYC), and Weeplaces, which contain user IDs, latitude and longitude, time, and more. We preprocess the dataset, and each user's trajectory is divided into subtrajectories according to the sampling frequency of the day. The description of the three datasets is shown in Table 1, and we divide each dataset into two parts. By randomly sampling samples from the original dataset, the top 80% of each user is selected as the training dataset and the remaining 20% is used for testing.
Baseline. We compare our model with several existing approaches. The introductions of those methods are shown as follows.

•
HIST: This method is a statistical method introduced by [38]. It is based on the classic least-cost two-part plot matching formula and realizes the re-identification task by matching the position histograms of different trajectories. It reflects the differences between different trajectories through KL divergence.  [25] proposed the DeepTUL model, which not only combines multiple characteristics of user mobility to model high-order complex mobility patterns but also learns from marked historical trajectories to capture the multi-period feature of user mobility and alleviate the problem of data sparsity.
Parameter settings. Table 2 lists the possible range of values of the different parameters and the values of the parameters used in our model. Metrics. We used two metrics, ACC@K and Macro-f1. ACC@K is used to measure the accuracy of links. The F1 value is the harmonic mean of the precision (macro-P) and recall (macro-R). The formula is as follows:

Performance Comparison
As shown in Tables 3-5, based on the three datasets, we found that our model outperformed all baselines in various evaluation indicators (Ours-GRU and Ours-LSTM are two variants of RNN encoder in our contrastive distillation model). Specifically, based on the Gowalla dataset, ACC@1, ACC@5, and Macro-F1 outperformed the second place on average by 6.14%, 6.58%, and 4.49%, respectively. Based on the Foursquare dataset, ACC@1, ACC@5, and Macro-F1 outperformed the second place on average by 25.49%, 24.76%, and 25.1%, respectively. Based on the Weeplaces dataset, ACC@1, ACC@5, and Macro-F1 outperformed the second place by an average of 18.56%, 17.91%, and 16.8%, respectively. TULER only pays attention to the relevant information between location points or a single trajectory during training and testing. Compared with TULER, TULVAE uses a generative framework to learn the potential variables of the trajectory and forms a fixed prior distribution through a variational autoencoder, but this ignores the potential distribution information of the inspected data. Although TULAR introduced the trajectory semantic vector (TSV) and attention mechanism, it still only pays attention to the correlation of multiple positions in a trajectory. Both Deep TUL and MainTUL use historical data, and DeepTUL uses historical trajectory data and current trajectory data to determine the user who belongs to the trajectory. MainTUL learns the latent information between pairs of tra-jectories using mutual distillation through data augmentation of historical trajectories. This means that it has higher accuracy than other methods. Different from the above approaches, our model takes into account both the position-to-position information between individual trajectories and the latent information between trajectories. The trajectory embedding of our model maps sparse trajectory points into high-dimensional spatial representations, capturing features and patterns in the trajectory data. The contrastive distillation layer learns more discriminating feature representations from the outputs of two different models, RNN and Transformer. The global attention mechanism selects and fuses the outputs from these two models to focus more on the information that contributes to our task. By combining these three modules, our model can focus not only on information at the location point level, but also on key information between trajectories. The information between trajectories pays more attention to the similarity and differences of human motion paths. As human movement patterns are regular, trajectory-level information will be more helpful for the model to mine trajectory data. In addition, we also considered making a trajectory library using historical trajectories. In our paper, we did not perform data augmentation but constructed positive and negative samples. The construction of positive and negative samples can introduce difference information between different user classes, so the model can learn more discriminating feature representations by comparing the features of positive and negative samples to better distinguish between different user categories.  We also note that for most models, model performance is worse when using data with more users than when using data with fewer users. This is intuitive because the more users there are, the more difficult it is to categorize the information. However, based on the Weeplaces dataset, the accuracy of our model does not decrease, but rather increases.
The number of users changed from 300 to 600, and our ACC@1 and Macro-F1 increased by an average of 3.09% and 3.39%, respectively. The previous model, which targeted data with fewer users, did have some improvements considering the historical data of all users. However, when the number of users is large, the large amount of historical data will also bring more noise, resulting in a sharp decrease in performance. However, our model pays attention to the correlation between pairs of trajectories during the training process and learns information between trajectories and within trajectories, so it still performs better on data with more users.

Ablation Study
To study the impact of the three forms of global attention on our model, we selected 100-600 users from three datasets for our experiments. In Figure 2a, as the number of users increases, the performance of the model first improves and then decreases. The performance of the model is lowest when the number of users is 500. This may be due to the excessive increase in the number of users, resulting in more candidate trajectories, making it difficult for our model to correctly identify anonymous trajectories. It can also be seen from Figure 2a that the attention mechanism in the form of the dot is better than general and concat. As seen in Figure 2b, as the number of users increases, the model performance drops slightly. Based on the Foursquare dataset, the effect of the three forms of attention mechanism is not very different. As seen in Figure 2c, when the number of users is 200, the model performance reaches its lowest. Afterward, as the number of users increases, the performance of the dot and general attention mechanism models improves. However, the performance of the attention mechanism model in the form of concat drops sharply when the number of users is 600. This may be because when the number of users is 600, it is difficult for the attention mechanism model in the form of concat to distinguish trajectories in the Weeplaces dataset. Also in the Weeplaces dataset, the attention mechanism model in the form of the dot is better than general and concat.

Strategy Study
We evaluate the influence of different sampling frequencies of the data on the model, as can be seen in Table 6. The model with a sampling interval of one week has the lowest accuracy, which may be due to the decrease in the number and length of trajectories, making it difficult for the RNN model to learn inter-trajectory dependencies. In addition, the weekly trajectory information also includes weekend information, resulting in more noise redundancy. The spatial distribution of user check-in data is broad, and the randomness of check-in location is strong. For the Gowalla and Foursquare datasets, they are sampled at intervals of a day when there are fewer users, which is more accurate. When there are many users, sampling at 6 h intervals is more accurate. and concat. As seen in Figure 2b, as the number of users increases, the model performance drops slightly. Based on the Foursquare dataset, the effect of the three forms of attention mechanism is not very different. As seen in Figure 2c, when the number of users is 200, the model performance reaches its lowest. Afterward, as the number of users increases, the performance of the dot and general attention mechanism models improves. However, the performance of the attention mechanism model in the form of concat drops sharply when the number of users is 600. This may be because when the number of users is 600, it is difficult for the attention mechanism model in the form of concat to distinguish trajectories in the Weeplaces dataset. Also in the Weeplaces dataset, the attention mechanism model in the form of the dot is better than general and concat.  We also evaluate the impact of different trajectory sampling frequencies on the recognition of anonymous trajectories by our model when constructing positive and negative samples. As shown in Figure 3. For the Gowalla dataset, as the sampling frequency increases, the performance of our model does not increase, which shows that our model can cover most of the information in the Gowalla data set at a lower sampling frequency. For the Foursquare dataset, as the sampling frequency increases, the performance of the model is slightly improved, and the performance of the model reaches its best when the sampling frequency is 35. But, as the sampling frequency increases again, our model performance degrades. This may be due to the large number of candidate user trajectories, which makes it difficult for the model to find dependencies from complicated information. For the Weeplaces dataset, the sampling frequency greatly improves from 5 to 15. Afterward, as the sampling frequency increases, the performance of the model tends to be stable. This shows that our model is robust and has good generalization ability when faced with data at different sampling frequencies. We also evaluate the impact of different trajectory sampling frequencies on the recognition of anonymous trajectories by our model when constructing positive and negative samples. As shown in Figure 3. For the Gowalla dataset, as the sampling frequency increases, the performance of our model does not increase, which shows that our model can cover most of the information in the Gowalla data set at a lower sampling frequency. For the Foursquare dataset, as the sampling frequency increases, the performance of the model is slightly improved, and the performance of the model reaches its best when the sampling frequency is 35. But, as the sampling frequency increases again, our model performance degrades. This may be due to the large number of candidate user trajectories, which makes it difficult for the model to find dependencies from complicated information. For the Weeplaces dataset, the sampling frequency greatly improves from 5 to 15. Afterward, as the sampling frequency increases, the performance of the model tends to be stable. This shows that our model is robust and has good generalization ability when faced with data at different sampling frequencies.

Conclusions
Given the relevant information between trajectories, a new comparative distillation network is proposed to solve the problem of trajectory re-identification. Based on the

Conclusions
Given the relevant information between trajectories, a new comparative distillation network is proposed to solve the problem of trajectory re-identification. Based on the contrastive learning framework and distillation network, we design the contrastive distillation encoder layer, which introduces a global attention mechanism to allow the model to adaptively pay attention to the important information between the trajectories. Therefore, our model learns not only relevant information between location points but also information between trajectories. When we aim to identify an anonymous trajectory, we determine the candidate trajectory according to the trajectory-user library. Then, we need to calculate the similarity between the anonymous trajectory and the candidate trajectory. Finally, the similarity scores of candidate users are calculated based on statistical methods to complete the trajectory re-identification task. Our experiments on three real check-ins datasets show that our model significantly outperforms the baseline on all evaluation metrics. In future work, we will test the use of more novel datasets and increase the number of user identification.