Abstract
Trajectory User Linking (TUL) is a pivotal technology for identifying and associating the trajectory information from the same user across various data sources. To address the privacy leakage challenges inherent in traditional TUL methods, this study introduces a novel federated learning-based TUL method: FedTULGAC. This approach utilizes a federated learning framework to aggregate model parameters, thereby avoiding the sharing of local data. Within this framework, a Graph Attention-based Trajectory User Linking and Embedding Regression (GATULER) model and an FL-DBSCAN clustering algorithm are designed and integrated to capture short-term temporal dependencies in user movement trajectories and to handle the non-independent and identically distributed (Non-IID) characteristics of client-side data. Experimental results on the synthesized datasets demonstrate that the proposed method achieves the highest prediction accuracy compared to the baseline models and maintains stable performance with minimal sensitivity to variations in client selection ratios, which reveals its effectiveness in bandwidth-constrained real-world applications.
1. Introduction
With the proliferation of mobile applications and personal intelligent devices, location-based application services have grown rapidly, giving rise to a variety of applications covering location services: Location-Based Social Networks (LBSNs) [1], such as Gowalla and Facebook Places, have accumulated a substantial amount of user geographic check-in data. These data provide a rich source of information for trajectory user linking (TUL). TUL refers to the process of identifying and establishing direct associations between trajectory data and corresponding users [2], which plays a role in the field of social security, such as preventing crime by identifying suspicious behavioral patterns [3,4].
Deep learning-based TUL methods have been widely studied. Q. Gao first introduced TUL via Embedding and RNN (TULER) [5], which applies word embedding and RNNs to achieve semi-supervised spatial learning. Subsequent studies integrated RNN-based models with semi-supervised learning, such as TUL via Variational AutoEncoder (TULVAE) by Zhou et al. [6]; the Semisupervised Trajectory-User Linking model with Interpretable representation and Gaussian mixture prior (STULIG) by Zhou et al. [7]; the Trajectory Generative Adversarial Network (TGAN) by Zhou and Yin et al. [8]; and attention-based models such as DeepTUL by Miao et al. [9] and Trajectory-User Link with Attention Recurrent Networks (TULAR) by Sun et al. [10]. Recent approaches utilize graph neural networks (GNNs) and graph attention networks (GATs) to effectively capture spatio-temporal dependencies. For example, GNNTUL by Zhou and Chen et al. [11] applied GraphSAGE to model trajectory structures; TULAM by Li et al. [12] adopted approximate one-hot encoding and multi-head attention for efficient learning with limited data. Further improvements in spatial reasoning were achieved through hierarchical attention models, such as AttnTUL by Chen et al. [4] and TUL via the Multi-Scale Graph Attention Network (TULMGAT) by Li et al. [13]. These deep learning-based trajectory user linking methods encounter the challenges of data privacy protection, as the methods’ model training requires a large number of centralized datasets. The centralized training strategies cannot strictly ensure the security of this data during transmission and centralized processing, thereby increasing the risk of privacy leakage [14,15]. Meanwhile, growing concerns over privacy protection have prompted numerous departments to issue relevant privacy and security regulations [16], which have further impeded the integration of diverse data sources. Therefore, how to ensure user data privacy to perform TUL tasks has become a key issue that needs to be addressed urgently.
Google’s proposed federated learning framework offers a new approach to address this problem [17]. The framework allows multiple clients to collaboratively train a global model without sharing local data, which preserves data privacy. Specifically, each client trains a model locally using their data and transmits the model’s gradients to a server. The server then aggregates these gradients to achieve a global model, which is then sent back to each client to iterate until convergence [18]. As an emerging distributed machine learning method, federated learning has begun to attract the attention of researchers in the field of trajectory data analysis. Zhang et al. proposed a federated learning and clustering method for trajectory data of intelligent networked vehicles, which uses a differential privacy federated learning framework to construct a sequence autoencoding network [19]. Wang proposed the ATPFL algorithm, which integrates the advantages of automatic machine learning and federated learning to solve the data silo problem [20].
Although the existing methods have achieved advancements, they cannot be tailored to directly address the challenges of trajectory user linking (TUL) due to the following limitations:
- These traditional deep learning-based trajectory user linking methods primarily focus on capturing short-term temporal dependencies in user movement trajectories. This hinders their ability to accurately model the evolution of user behavior over extended periods and to capture complex movement patterns.
- These existing federated learning methods in the trajectory data analysis field cannot effectively handle Non-IID characteristics [21,22] and the spatiotemporal distribution heterogeneity of clients’ trajectory data, which results in a degradation of model accuracy.
Therefore, this paper explores a novel federated learning method for trajectory user linking, which aims to fill the gap in the existing methods. The primary contributions of this paper are as follows:
- We propose a novel federated learning-based TUL method named FedTULGAC to address the challenge of privacy preservation in trajectory user linking. Our method enables distributed data processing by exchanging model parameters instead of sharing raw trajectory data. Under the coordination of a central server, the FedTULGAC framework enables multiple clients to collaboratively optimize a global model.
- We design the GATULER model and the FL-DBSCAN algorithm and integrate them into FedTULGAC. The GATULER model uses the dynamic graph attention mechanism to capture the complex features of trajectory data. The FL-DBSCAN algorithm optimizes the aggregation of model parameters across clients to mitigate the Non-IID characteristics and the spatiotemporal distribution heterogeneity of client-side data.
- We conducted extensive experiments on the synthesized Gowalla and Foursquare datasets. The results indicate that the FedTULGAC method achieves the highest prediction accuracy compared to baseline models while safeguarding user privacy, and it maintains the training model’s stability and robustness.
The rest of this paper is organized as follows: Section 2 defines the preliminary preparation of the proposed method. Section 3 outlines the federated learning framework of the FedTULGAC method and details the GATULER model and the FL-DBSCAN algorithm. Section 4 evaluates the proposed method’s performance with experiments conducted on the synthesized datasets. Finally, Section 5 summarizes the contributions of this study and suggests directions for future research.
2. Preliminary Preparation
In this section, we begin with a formulation of the trajectory user linking problem. Subsequently, we provide a detailed description of the trajectory user linking within the context of federated learning.
2.1. Trajectory User Link Problem
The set of users, locations, and times is represented as and . Each user’s trajectory is a sequence composed of a series of check-ins, where each check-in includes the user’s location at a specific time. Therefore, for a user , the trajectory can be represented as
where represents the spatial location of user at time , and specifies the longitude and latitude coordinates of the spatial location .
For the trajectory user linking, we need to match the trajectory sequence with a user in the user set . This matching process needs to consider the overall characteristics of the trajectory sequence. To capture this linking relationship, we define a model . The input of model includes the trajectory as well as the information of user set . The output of the model is the user that best matches the trajectory , which is represented as
2.2. Federated Learning of Trajectory User Linking
The objective of a trajectory user linking problem in federated learning mode is to associate the trajectory with the user set across clients. Each client possesses a user dataset and a trajectory dataset, and locally enables the training of the trajectory user linking model. To optimize the local model, the model parameter of is adjusted by minimizing the loss function with the mean squared error loss function. The loss function is defined as follows:
where represents the model parameter, represents the trajectory sequence, and represents the user associated with the trajectory sequence . The function is the specific implementation of the model , which takes the trajectory sequence and model parameters as inputs.
Each client performs a local model update using Stochastic Gradient Descent (SGD) on its parameters , as follows:
where represents the model parameters of the -th client during the -th round of training, represents the learning rate and represents the gradient of the loss function with respect to the model parameters . After rounds of SGD iterations, the server performs model aggregation to achieve the global parameters from all clients , as follows:
where represents the proportion of the trajectory data size of client relative to the total trajectory data volume, serving as the weight for model aggregation; represents the local model parameters of client after local training iterations. Once the model aggregation is completed, the server distributes the updated global model parameters to all clients for the subsequent training round.
3. Methods
In this study, we propose an innovative federated learning-based solution for trajectory user linking. As illustrated in Figure 1, the proposed framework comprises three key components: a central server, terminal databases, and terminal clients. The central server is responsible for model distribution, aggregation, communication coordination, and system monitoring. Each terminal client hosts a local database, which manages data storage, access, and protection. The clients collect user and trajectory datasets, perform local model training, and transmit the updated model parameters to the central server.
Figure 1.
Framework of FedTULGAC.
3.1. Model: GATULER
To improve the accuracy of trajectory user linking, we present a Graph Attention-based Trajectory User Linking and Embedding Regression (GATULER) model. Each terminal client collects user and trajectory datasets and trains a local GATULER model. The central server aggregates the model parameters transmitted by the clients to obtain a global GATULER model. By employing a dynamic graph attention mechanism, GATULER captures complex interactions among users. The architecture of the model is illustrated in Figure 2. The implementation of this model consists of four phases:
Figure 2.
Structure of the GATULER model.
- Trajectory Graph Construction: Two types of trajectory graphs are constructed: the undirected graph and the directed graph . is used to represent interactions or movement relationships between users, while further captures the directionality of user interactions or movement. Finally, these two graphs are fused to obtain the final trajectory graph , which incorporates both geographical proximity and temporal movement order. The fusion is defined by the following equation:
- Node Graph Embedding and Graph Attention Computation: The trajectory graph is used to construct initial embeddings for user and location through their respective embedding layers. This process generates embeddings for users and locations, denoted as and , respectively. These embeddings are subsequently transformed into one-dimensional vectors using the “Flatten” operation, as follows:
Next, this process computes the graph attention weights between nodes utilizing a softmax function and the LeakyReLU activation function. The attention weight is formally defined as follows:
where denotes the graph attention weight of node to node , represents a learnable attention mechanism parameter, represents the feature transformation matrix, represents the feature vector of node , and represents the set of neighboring nodes of node .
Finally, using the computed attention weight , the updated embedding representation of node is obtained by aggregating the embeddings of its neighbors :
- Trajectory Vector Representation, for a given user trajectory , this phase first retrieves , , an corresponding to each check-in point in , and concatenates them to form . The computation for the -th node in the trajectory is as follows:
Next, to capture the temporal and user behavioral patterns within the trajectory sequence, a sequence of concatenated vectors for all nodes in the trajectory, , is fed into the Recurrent Neural Networks (RNNs). This network processes each concatenated vector sequentially, maintaining a hidden state that encodes the trajectory information up to the current time step.
where denotes the hidden state of the RNN after processing the -th node in the trajectory, and is initialized as a zero vector.
Once the RNN processes the entire trajectory sequence, the final trajectory graph embedding vector is obtained by averaging the hidden states across all time steps. The computation is as follows:
where is the number of check-ins in the trajectory .
- Trajectory-User Linking: The model leverages the features extracted and integrated from preceding stages to predict the association probability between each user and a given trajectory. The computation is as follows:
3.2. FL-DBSCAN
3.2.1. Design of Implementation Algorithm
Within the federated learning framework, each terminal client functions as an independent node with its own distinct datasets. These datasets typically exhibit Non-IID characteristics and spatiotemporal heterogeneity. To effectively handle these characteristics and mitigate the accuracy deterioration of the FedTULGAC method, we developed an innovative model aggregation strategy, namely the Algorithm 1 FL-DBSCAN algorithm. Specifically, the terminal clients calculated the local density of their respective datasets, while the central server adjusted the global density threshold based on the local density information provided by each client. This process ensured that the global model effectively reflects the data characteristics of all clients.
| Algorithm 1: FL-DBSCAN Input: Total number of clients , Client selection ratio , Number of communication rounds , Number of local epochs , Batch size Output: |
This algorithm begins by initializing the global model weights . It then proceeds iteratively for a total of communication rounds. In each round , the algorithm determines the number of clients to be randomly selected, where satisfies . Subsequently, through the subroutine, the algorithm randomly selects clients from all clients to get the set .
For each client in , the algorithm transmits the global model weights to the client. The subroutine is then invoked, wherein each client performs local iterations using a learning rate and a batch size to get the model weights . Following local training, the subroutine evaluates on client local test dataset to get the accuracy metric . After all, clients have completed their local training, the server computes a distance matrix among the models of the selected clients using the Algorithm 2 subroutine.
| Algorithm 2: Subroutine: CalculateDistanceMatrix |
| Input: Set of selected clients Output: |
This subroutine takes as input a set of clients and outputs a distance matrix . The subroutine initiates by constructing a zero matrix of size , where denotes the cardinality of clients in set .
The subroutine focuses on the consistency of the “direction” of client model updates, rather than the magnitude of the “step size”. Consistent update directions indicate that the clients are learning similar patterns. In this paper, the cosine distance is employed to quantify the angular difference between update vectors. The formula for computing the distance is given by:
Then, the subroutine iterates over each unique pair of clients and within the set by calculating the cosine distance between their model weights and populating the corresponding entries in the distance matrix . Due to the symmetry of the distance matrix, the subroutine only computes the upper triangular portion and mirrors the values to the lower triangular portion. Ultimately, the subroutine returns the complete distance matrix , which provides distance information for subsequent clustering and global model aggregation steps.
Next, the Algorithm 3 executes the subroutine to cluster the clients and get a cluster list .
| Algorithm 3: Subroutine: DBSCANClustering |
| Input: Distance matrix , Neighborhood radius , Minimum number of points Output: GroupList visited ← InitializeVisitedSet() for each client do if client is not visited then Mark as visited Ni ← FindNeighbors(, ) if then Form and expand cluster else Mark as noise end if end if end for return GroupList |
This subroutine accepts three input parameters: the dataset , neighborhood radius , and the minimum number of points and outputs a list of cluster assignments: GroupList. The subroutine initializes a visited set to keep track of visited clients. It then iterates through each client in the selected client set. For each unvisited client , the subroutine finds its neighbors within the range. If the number of points in reaches or exceeds , a cluster is formed and expanded. Finally, the subroutine returns the GroupList containing the cluster identifier for each client.
Subsequently, the algorithm updates the client model weights through the Algorithm 4 subroutine. This subroutine accepts the following inputs: the model parameters of each client at time step , the client grouping list GroupList, the global dataset , and the performance metrics of each client. It outputs the updated client model parameters . The core process of the subroutine involves iterating over each cluster in GroupList. The cluster center is first calculated using the CalculateClusterCenter function according to the following formula:
where is the number of clients in cluster .
For each client within the cluster, this subroutine invokes the CalculateDistance function to determine the distance between its model parameters and the cluster center as per the following formula:
The performance metric of each client and are combined to achieve the weight as per the following formula:
where is the maximum performance metric among all clients.
The client model parameters are updated through a weighted average by combining the current model parameters , the cluster center parameters and the weight as per the following formula:
| Algorithm 4: Subroutine: UpdateClientModels |
| Input: Current global model weights at time step , List of clusters GroupList, Distance matrix , Performance metrics Output: for each client all clients do for each cluster GroupList do if cluster is not noise then end if end for end for |
Finally, for each client in , the algorithm adjusts the global model weights using the subroutine to achieve the new global model weights . After rounds of iteration, the algorithm returns the final global model weights . The detailed descriptions of subroutines , , and are in Appendix A.
3.2.2. Computational Complexity Analysis
The server-side clustering process in the FL-DBSCAN algorithm contains three key subroutines: , and . The computational complexity analysis of these subroutines is a critical factor for assessing the FedTULGAC method’s training time performance. Let denote the number of clients selected in the communication round , let represent the dimensionality of the model parameter vector and let be the number of clusters found by DBSCAN.
- The subroutine is responsible for computing the pairwise cosine distance matrix , which serves as the foundation for the FL-DBSCAN algorithm. This subroutine initializes an matrix and employs a nested loop structure. The outer loop iterates times, while the inner loop iterates over clients, resulting in unique client pairs . For each pair, it retrieves two model vectors of size and computes the cosine distance between them. The cosine distance calculation, given by , involves a dot product and norm calculations, each of which is an operation. Therefore, the time complexity of this subroutine is , which indicates its complexity is quadratic in the number of clients and linear in the model dimensionality .
- The subroutine performs density-based clustering on the clients using the precomputed distance matrix . This subroutine iterates through each of the clients. For each unvisited client, it performs a query to find all neighbors within a radius . Each query requires scanning a row of the matrix to find entries where , which is an operation. In the worst case, every client is a core point, and its neighborhood must be expanded, which potentially requires a query for all clients. Then, the worst-case time complexity of this subroutine is , which indicates this subroutine’s complexity is independent of the model dimensionality .
- The subroutine contains a nested loop structure. The outer loop iterates over all clients. For each client, the inner loop iterates over the clusters in the GroupList to identify the client’s assignment. Once the correct cluster is found, the subroutine calculates the cluster centroid, computes the distance from the client’s model to the centroid and performs a weighted average of the client’s model and the cluster centroid. Then, this subroutine’s time complexity is . In the worst case, where each client forms its own cluster (), the complexity becomes . However, in practice, is expected to be much smaller than .
Finally, the total computational cost for the server-side clustering process in one communication round is the sum of the complexities of the three subroutines: . For the trajectory user linking federated learning setting, as the proposed GATULER model () is large, the overall complexity of the server-side clustering process can be approximated as quadratic in the number of selected clients and linear in the model dimensionality .
4. Results and Discussion
4.1. Experimental Environment Settings
4.1.1. Experimental Environment
The proposed FedTULGAC method is implemented using the Keras deep learning framework. Table 1 lists the version of the selected operating system, programming environment, and data processing library. Table 2 details the configuration of the hardware environment, including the CPU model, the number of cores and threads, as well as the GPU model, the memory size, and the quantity.
Table 1.
Experimental Software Environment Configurations.
Table 2.
Experimental Hardware Environment Configurations.
4.1.2. Experimental Dataset
Our experiments used two representative real-world datasets of check-in data from location-based social applications: Gowalla and Foursquare, which are publicly available resources for geographic location data mining and social network research. The two datasets include user IDs, location IDs, and check-in timestamps, which provide a rich source of user movement data. To evaluate the robustness of the proposed model against Non-IID data characteristics and spatiotemporal heterogeneity, we synthesized an experimental dataset by randomly selecting 250 users with their initial 40 trajectories from Gowalla and 300 users with their 20 trajectories from Foursquare.
Furthermore, we used regional coverage, location overlap, KL divergence, and Top-5 location overlap to measure the heterogeneity of the geographical distribution of experimental data. Detailed information on the metrics is shown in Table 3.
Table 3.
Heterogeneity Index of Geographic Spatial Distribution of Experimental Data.
Then, the two synthesized datasets were randomly mixed and partitioned among 10 terminal clients. The user counts of the mixed datasets on 10 clients follow a Zipf distribution with parameter , as shown in Table 4, which indicates a significant variation among clients’ datasets. Therefore, the experimental data further simulated the Non-IID characteristics and spatiotemporal heterogeneity of the client datasets in a federated learning environment.
Table 4.
User Counts for Mixed Datasets Across 10 Clients.
In terms of experimental setup, the common hyperparameters for the proposed method and baseline methods were initialized as follows:
- The local learning rate was set to 0.01, a standard value for SGD-based optimizers when training deep learning models on relatively homogeneous data subsets. Coupled with a batch size , this configuration ensures stable local updates without excessive noise. The number of local epochs allows for local progress on each client’s dataset.
- The global training epochs allowed the following experiments: Comparison of Model Performance and Variation with sampling rates, respectively, which provides insight into the proposed method’s stability and efficiency in the training process.
4.2. Experimental Results and Discussion
4.2.1. GATULER Model Performance
- Comparison between GATULER and Traditional TUL Models
The GATULER model and the FL-DBSCAN algorithm are two innovations of the FedTULGAC method. We first conducted experiments in a centralized training mode to compare the performance of the GATULER model against traditional deep-learning-based TUL models. To benchmark GATULER’s performance, we compared it with several TUL approaches with the temporal and semantic modeling of individual trajectories: TULER, TULVAE and STULIG, and several TUL approaches with graph-based spatial relationships or advanced attention mechanisms: GTUL, TULMGAT and TULAM.
Following the standard evaluation criteria, this study used Accuracy (), Precision (), Recall (), and score to evaluate the performance of the TUL task. To validate statistical significance, we performed independent t-tests () comparing GATULER against all baseline models. All performance metrics were reported as the mean standard deviation over five independent runs. Table 5 presents a detailed comparison of the model accuracy of GATULER with other models on the two synthesized datasets.
Table 5.
Accuracy Comparison of GATULER and Traditional TUL Models.
From the experimental results, we can observe the following two points:
- GATULER achieved significant improvements with the highest accuracy (50.56%) and the lowest standard deviation (0.38) on the Gowalla dataset. Although GATULER’s accuracy (60.21%) on the Foursquare dataset is nearly on par with TULMGAT’s highest accuracy (60.22%), it achieved significant improvement with a lower standard deviation (0 vs. 0.43). This improvement underscores the efficacy of GATULER’s graph attention mechanism in capturing key information in user trajectory data. Both GATULER and TULMGAT design graph-based embedding and attention mechanisms to achieve high prediction accuracy, but GATULER adopts a dynamic attention mechanism that does not rely on random walks or sampling to calculate attention values.
- Compared with all baseline models, GATULER achieved top performance on both the synthesized datasets with the highest Prec of 44.22% and 58.29%, respectively. However, GATULER’s Recall and F1-score are lower than TULMGAT and TULAM. These experimental results demonstrate a trade-off between accuracy and recall in GATULER. In fact, GATULER uses an attention mechanism and embedded history to achieve high confidence prediction, but it will also miss some samples.
- Ablation Analysis
We conducted ablation studies by designing the following variants of the model: M-GCN, which replaced the graph attention mechanism with a traditional GNN; M-GC, which used only the spatial graph to learn the embedding representations of check-in points; and M-GT, which employed only the temporal graph to learn the embedding representations of check-in points. The comparison of the accuracy of GATULER with that of M-GCN, M-GC, and M-GT is depicted in Figure 3.
Figure 3.
Comparison of accuracy of GATULER with M-GCN, M-GC, and M-GT.
GATULER consistently outperforms the other three models across all evaluation metrics (Accuracy, Precision, Recall, and F1-Score) on both datasets. GATULER outperforms M-GCN, highlighting the advantage of the graph attention mechanism in capturing the complex inter-node dependencies beyond what traditional GNNs offer. GATULER yields a significant performance gain over both M-GC and M-GT on both datasets. The main reason is that M-GC relies solely on the spatial graph , overlooking the critical temporal graph to learn embedding representations of check-in points, while M-GT relies exclusively on the temporal graph , missing spatial context.
4.2.2. FL-DBSCAN Algorithm Performance
- Comparison between FedTULGAC and typical federated learning method
In this experiment, we examined the advantages of the FL-DBSCAN algorithm within the FedTULGA method. We consider two traditional model aggregation methods: FedAvg [17] and FedProx [23]. FedAvg is a classical federated learning algorithm where clients train models locally on their data and the server aggregates these local models by computing a weighted average of their parameters. FedProx, a variant of FedAvg, is specifically designed to address the challenge of statistical heterogeneity (non-IID data). FedProx introduces a proximal term to the local objective function, which constrains local updates by penalizing significant deviation from the global model. To ensure a fair comparison, we integrated each aggregation method with the GATULER model to construct two baseline methods: FedAvg + GATULER, FedProx + GATULER. In terms of the evaluation metrics, we adopted the standard evaluation criteria for the federated learning setting: training loss, training time and accuracy. The experimental results are shown in Figure 4 and Figure 5.
Figure 4.
Comparison of loss values during the training process.
Figure 5.
Comparison of Model Training Time.
As illustrated in Figure 4, the evaluated models exhibit significant differences in both convergence speed and final performance. Among the federated learning models, the proposed FedTULGAC model demonstrates a superior convergence curve compared to the baseline models, FedAvg and FedProx. After an initial phase, the loss value of FedTULGAC decreases more steadily and reaches a lower final value than both FedAvg and FedProx. This improvement stems from the FL-DBSCAN algorithm; specifically, by clustering clients with similar data distributions, it effectively mitigates the performance degradation typically caused by data heterogeneity in federated settings.
Figure 5 illustrates the comparative training time efficiency among the evaluated models. Although the FedTULGAC model’s computational cost increases linearly with the number of epochs, it exhibits a marginally longer training time compared to the FedAvg and FedProx models. According to the analysis in Section 3.2.2, the FL-DBSCAN algorithm’s computational complexity is approximately quadratic in the number of selected clients and linear in the model dimensionality . Thus, while the FL-DBSCAN algorithm introduces a sophisticated server-side clustering mechanism to improve learning in non-IID settings, it comes at the cost of significant server-side computation. Future work may need to investigate approximate distance calculations to alleviate this bottleneck for very large values of and , and achieve an optimal trade-off between the algorithmic benefit of client clustering and the computational scalability on the server.
- Analysis of Hyperparameters
- Accuracy variation and clustering factor
This experiment analyzes the performance variation in the FedTULGAC model with respect to the two hyperparameters in DBSCAN clustering: the neighborhood radius (ε) and the minimum number of points (). ε defines the maximum distance between two update vectors for them to be considered part of the same neighborhood. The ε value can moderate angular separation and effectively group clients whose model updates are directionally similar in the high-dimensional parameter space. The parameter specifies the minimum number of clients required to form a cluster. The optimal values of ε and can be determined empirically. The experimental results are presented in Figure 6 and Figure 7.
Figure 6.
Variation in model accuracy with the neighborhood radius.
Figure 7.
Variation in model accuracy with the minimum number of points.
As illustrated in Figure 6, the test accuracy improves as the number of training rounds increases for all the neighborhood radii (ε = 0.3, 0.5, 0.8). The green dashed line (ε = 0.3) consistently shows the lowest accuracy throughout the training process. After 100 rounds, it reaches a test accuracy of only about 0.6, which is significantly lower than the other settings. The red solid line (ε = 0.5) demonstrates the highest accuracy. It achieves nearly 0.8 test accuracy by round 40 and maintains this performance through round 100. The blue dotted line (ε = 0.8) starts with an initial accuracy similar to ε = 0.3 but is gradually outperformed after 20–30 rounds, and eventually plateaus at about 0.75 accuracy. The results strongly support selecting ε = 0.5 for this federated learning setup, as it maximizes test accuracy while maintaining stable convergence.
As illustrated in Figure 7, all the test accuracies improve with increasing training rounds. Specifically, the blue curve–diamonds line (c = 1) achieves the lowest accuracy throughout training and plateaus at a modest level significantly below the other settings. The orange curve–stars line (c = 3) demonstrates the highest accuracy and outperforms both other configurations from early rounds and maintains a clear lead throughout. The green curve–crosses line (c = 5) shows intermediate performance, and it performs better than c = 1 but consistently worse than c = 3. The results indicate that c = 3 strikes an optimal balance: the threshold is high enough to require sufficient clients for a robust cluster, yet not so high as to impede timely cluster formation during training.
- 2.
- Loss variation with client selection ratios
The client selection ratio is the actual number of clients participating in each round of training by the total number of clients, which is also an important indicator reflecting the Non-IID characteristics of the experimental datasets.
The client selection ratio is defined as the ratio of the actual number of clients participating in each training round to the total number of clients. It serves as an important indicator reflecting the Non-IID characteristics of the experimental datasets. We further evaluate the scalability of the proposed FedTULGAC model by adjusting this ratio. The experimental results are shown in Figure 8.
Figure 8.
Variation in model loss values with the client selection ratio.
As shown in Figure 8, we observed that as the client selection ratio decreased across the four different settings, the model’s loss value decreased at a slower rate. This was attributed to the limited representativeness of a small sample size. However, this trend became less pronounced after 100 training rounds. Specifically, between rounds 100 and 200, the training processes of all models stabilized, exhibiting smoother convergence curves and smaller fluctuations. Beyond 200 rounds, all models achieved good predictive performance with very low final loss values. The experimental results indicate that the FedTULGAC model is insensitive to the client selection ratio and maintains high prediction accuracy even at low ratios.
5. Conclusions
In this study, we proposed an innovative federated learning-based trajectory user linking method named FedTULGAC, which was designed to overcome the limitations of traditional methods. By introducing the GATULER model and the FL-DBSCAN clustering algorithm, this method enhances the security of data processing and improves the performance of trajectory user linking tasks. Extensive experimental results on synthesized datasets indicated that while safeguarding user privacy, FedTULGAC achieves significantly higher predictive accuracy compared to both traditional TUL models and typical federated learning methods. Furthermore, the analysis of the clustering factor hyperparameter provides guidance for determining its optimal value. The experimental results on loss variation with different client selection ratios indicate that FedTULGAC can consistently achieve high prediction accuracy even at low ratios, which reveals its effectiveness and practicality in real-world applications with bandwidth limitations.
Future research will focus on enhancing the computational efficiency of FedTULGAC to better balance accuracy and training costs, particularly by reducing the overhead associated with its clustering algorithm. Additionally, with the advancement of multimodal fusion technologies [24] and generative Large Language Models (LLMs) [25,26], integrating FedTULGAC with these techniques represents a promising direction, which could significantly enhance the model’s ability to perform large-scale and semantic-aware trajectory user linking.
Author Contributions
Conceptualization: H.Z.; Data curation: H.Z. and Y.X.; Formal analysis: H.Z. and Y.X.; Investigation: H.Z. and W.W.; Methodology: Y.X., H.J. and Y.G.; Project administration: H.Z.; Resources: Y.L. (Yuanjian Liu); Software: Y.L. (Yi Li) and Y.L. (Yuhao Luo); Supervision: H.Z.; Validation: Y.L. (Yuanjian Liu) and W.W.; Writing–review and editing: Y.L. (Yi Li) and Y.L. (Yuhao Luo). All authors have read and agreed to the published version of the manuscript.
Funding
This research was funded by the Natural Science Foundation of China (Grant No. GZ62371248, GZ41201465); the Postgraduate Research and Practice Innovation Program of Jiangsu Province (Grant Nos. KYCX25_1220; KYCX21_0764 and KYCX21_0765); China State Railway Group Co., Ltd. Science and Technology Research and Development Program Laboratory Basic Research Project (L2024G006); the “Location Service” Ideological and Political Demonstration Course Construction Project (Grant No. 30032SFKC2303); and the Science and Technology Research and Development Program of China State Railway Group Co., Ltd. (Grant No. N2024G055).
Data Availability Statement
The data that support the findings of this study are openly available in the Gowalla and Foursquare datasets. The Gowalla dataset can be accessed at https://snap.stanford.edu/data/loc-Gowalla.html (accessed on 1 May 2025). The Foursquare dataset is available at https://sites.google.com/site/yangdingqi/home/foursquare-dataset (accessed on 1 May 2025).
Acknowledgments
The authors would like to sincerely thank all professionals for making available the open-source trajectory data and related comparison methods.
Conflicts of Interest
The authors declare that there are no conflicts of interest.
Appendix A
Appendix A.1
Algorithm A1 Subroutine RandomSelect is a pivotal component tasked with randomly selecting a specified number of clients to participate in each round of federated learning training. This subroutine takes two parameters: , the number of clients to be selected, and , the total number of clients. This subroutine initializes an empty set , and then enters a loop where it randomly picks an index from to . If the client is not already in , it is added. This subroutine continues until contains unique clients. The set is then returned as the group of selected clients for that round.
| Algorithm A1: Subroutine: RandomSelect |
| Input: Number of clients to be selected , Total number of clients Output: while do Randomly select an index If client then end if end while return |
Appendix A.2
Algorithm A2 Subroutine LocalTraining begins with global model weights and updates the model weights through iterative training on a local dataset . In each training epoch, the subroutine processes batches from the dataset. It first runs forward propagation to make predictions and calculate losses. The subroutine also uses an attention mechanism to focus on important features and calculates attention scores for user and trajectory features. The training continues for a set number of epochs, . At the end, the subroutine outputs the optimized model weights, , which represent the outcome of the training performed on the local dataset.
| Algorithm A2: Subroutine: LocalTraining |
| Input: Local datase , Global model weights , Local learning rate Local epochs , Batch size Output: For to do for each batch do end for end for return |
Appendix A.3
Algorithm A3 Subroutine TestAccuracy evaluates the performance of the locally updated model weights on the client’s local test set . The subroutine initiates by loading the test set and resetting an accuracy counter. It then iterates over each sample in , using the current local model weights to generate predictions and assess their correctness. Upon completion of the iteration over all test samples, the subroutine calculates the accuracy as the proportion of correct predictions to the total number of samples, as the formula:
where is the count of correct predictions and is the total number of samples in the test set.
| Algorithm A3: Subroutine: TestAccuracy |
| Input: Locally updated model weights , Local test set Output: Load the local test set for each sample end for return |
Appendix A.4
Algorithm A4 Subroutine AdjustGlobalModelWeights accepts as input the updated client model weights and their corresponding performance metrics . This subroutine initializes the next iteration’s global model weights with the current global model weights . For each client within the selected set , it calculates the weight based on the client’s performance metric . The global model weights are then updated by incorporating the weighted difference between the client’s updated model weights and the current global model weights. After all clients have been processed, the global model weights are normalized to ensure they remain within an appropriate scale.
| Algorithm A4: Subroutine: AdjustGlobalModelWeights |
| Input: Updated client model weights , Performance metric of the client for each client do end for |
References
- Wei, X.; Qian, Y.; Sun, C.; Sun, J.; Liu, Y. A survey of location-based social networks: Problems, methods, and future research directions. Geoinformatica 2022, 26, 159–199. [Google Scholar] [CrossRef] [Scilit]
- Deng, L.; Sun, H.; Zhao, Y.; Liu, S.; Zheng, K. S2TUL: A Semi-Supervised Framework for Trajectory-User Linking. In Proceedings of the 16th ACM International Conference on Web Search and Data Mining, Singapore, 27 February–3 March 2023. [Google Scholar] [CrossRef] [Scilit]
- Wu, H.; Xue, M.; Cao, J.; Karras, P.; Ng, W.S.; Koo, K.K. Fuzzy Trajectory Linking. In Proceedings of the IEEE 32nd International Conference on Data Engineering (ICDE), Helsinki, Finland, 22 June 2016. [Google Scholar] [CrossRef] [Scilit]
- Chen, W.; Huang, C.; Yu, Y.; Jiang, Y.; Dong, J. Trajectory-User Linking via Hierarchical Spatio-Temporal Attention Networks. ACM Trans. Knowl. Discov. Data 2024, 18, 22. [Google Scholar] [CrossRef] [Scilit]
- Gao, Q.; Zhou, F.; Zhang, K.; Trajcevski, G.; Luo, X.; Zhang, F. Identifying human mobility via trajectory embeddings. In Proceedings of the 26th International Joint Conference on Artificial Intelligence, Melbourne, Australia, 19–25 August 2017. [Google Scholar]
- Zhou, F.; Gao, Q.; Trajcevski, G.; Zhang, K.; Zhong, T.; Zhang, F. Trajectory-user linking via variational autoencoder. In Proceedings of the 27th International Joint Conference on Artificial Intelligence, Stockholm, Sweden, 13–19 July 2018. [Google Scholar]
- Zhou, F.; Liu, X.; Zhang, K.; Trajcevski, G. Toward discriminating and synthesizing motion traces using deep probabilistic generative models. IEEE Trans. Neural Netw. Learn. Syst. 2021, 32, 2401–2414. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Zhou, F.; Yin, R.; Trajcevski, G.; Zhang, K.; Wu, J.; Khokhar, A. Improving human mobility identification with trajectory augmentation. GeoInformatica 2021, 25, 453–483. [Google Scholar] [CrossRef] [Scilit]
- Miao, C.; Wang, J.; Yu, H.; Zhang, W.; Qi, Y. Trajectory-user linking with attentive recurrent network. In Proceedings of the 19th International Conference on Autonomous Agents and MultiAgent Systems, Auckland, New Zealand, 9–13 May 2020. [Google Scholar]
- Sun, T.; Xu, Y.; Wang, F.; Wu, L.; Qian, T.; Shao, Z. Trajectory-user link with attention recurrent networks. In Proceedings of the 2020 25th International Conference on Pattern Recognition, Milan, Italy, 10–15 January 2021. [Google Scholar] [CrossRef] [Scilit]
- Zhou, F.; Chen, S.; Wu, J.; Cao, C.; Zhang, S. Trajectory-user linking via graph neural network. In Proceedings of the ICC 2021—IEEE International Conference on Communications, Montreal, QC, Canada, 14–23 June 2021. [Google Scholar] [CrossRef] [Scilit]
- Li, H.; Cao, S.; Chen, Y.; Zhang, M.; Feng, D. TULAM: Trajectory-user linking via attention mechanism. Sci. China Inf. Sci. 2024, 67, 112103. [Google Scholar] [CrossRef] [Scilit]
- Li, Y.; Sun, T.; Shao, Z.; Zhen, Y.; Xu, Y.; Wang, F. Trajectory-user linking via multi-scale graph attention network. Pattern Recognit. 2025, 158, 110978. [Google Scholar] [CrossRef] [Scilit]
- Shi, H.; He, D.; Jin, F.; Hua, W.; Kim, J.; Wang, Q.; Zhou, X. A survey and experimental study on neural trajectory-user linking models. IEEE Trans. Knowl. Data Eng. 2025, 37, 6782–6798. [Google Scholar] [CrossRef] [Scilit]
- Chen, H. A Comprehensive Review of Machine Learning Privacy. In Proceedings of the 2024 6th International Conference on Machine Learning, Big Data and Business Intelligence, Hangzhou, China, 1–3 November 2024. [Google Scholar] [CrossRef] [Scilit]
- Tesfay, W.B.; Hofmann, P.; Nakamura, T.; Kiyomoto, S.; Serna, J. PrivacyGuide: Towards an Implementation of the EU GDPR on Internet Privacy Policy Evaluation. In Proceedings of the Fourth ACM International Workshop on Security and Privacy Analytics, Tempe, AZ, USA, 21 March 2018. [Google Scholar] [CrossRef] [Scilit]
- McMahan, B.; Moore, E.; Ramage, D.; Hampson, S. Communication-Efficient Learning of Deep Networks from Decentralized Data. arXiv 2017. [Google Scholar] [CrossRef] [Scilit]
- Khan, R.; Saeed, U.; Koo, I. FedLSTM: A Federated Learning Framework for Sensor Fault Detection in Wireless Sensor Networks. Electronics 2024, 13, 4907. [Google Scholar] [CrossRef] [Scilit]
- Kong, X.; Lu, L. Vehicle trajectory federated embedding learning and clustering under privacy protection. J. Nanjing Norm. Univ. 2022, 22, 80–86. [Google Scholar] [CrossRef]
- Wang, C.; Chen, X.; Wang, J.; Wang, H. ATPFL: Automatic Trajectory Prediction Model Design Under Federated Learning Framework. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, New Orleans, LA, USA, 19–24 June 2022. [Google Scholar]
- Zhu, H.; Xu, J.; Liu, S.; Jin, Y. Federated learning on non-IID data: A survey. Neurocomputing 2021, 465, 543–556. [Google Scholar] [CrossRef] [Scilit]
- Nguyen, N.H.; Le Nguyen, P.; Nguyen, T.D.; Nguyen, T.T.; Nguyen, D.L.; Nguyen, T.H.; Pham, H.H.; Truong, T.N. FedDRL: Deep Reinforcement Learning-based Adaptive Aggregation for Non-IID Data in Federated Learning. In Proceedings of the 51st International Conference on Parallel Processing, Bordeaux, France, 29 August–1 September 2022. [Google Scholar] [CrossRef] [Scilit]
- Brown, L.C.; Green, D.E. Federated Optimization in Heterogeneous Networks. Adv. Neural Inf. Process. Syst. 2023, 345, 45–67. [Google Scholar]
- Yan, J.; Cheng, Y.; Zhang, F.; Li, M.; Zhou, N.; Jin, B.; Wang, H.; Yang, H.; Zhang, W. Research on Multimodal Techniques for Arc Detection in Railway Systems with Limited Data. Struct. Health Monit. 2025, 5, 26. [Google Scholar] [CrossRef] [Scilit]
- Gong, L.; Guo, S.; Han, X.; Lin, Y.; Lin, Y.; Liu, Y.; Lu, Y.; Wan, H.; Zhang, X. Mobility-llm: Learning visiting intentions and travel preferences from human mobility data with large language models. In Proceedings of the 38th International Conference on Neural Information Processing Systems, Vancouver, BC, Canada, 9–15 December 2024. [Google Scholar]
- Wang, H.; Song, Y.; Yang, H.; Liu, Z. Generalized Koopman Neural Operator for Data-Driven Modeling of Electric Railway Pantograph-Catenary Systems. IEEE Trans. Transp. Electrif. 2025, 11, 14100–14112. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).







